Courseiva
Network ImplementationeasyMultiple ChoiceObjective-mapped

How to Provide Secure Outbound Internet Access to Private Subnets Using a NAT Gateway

A company is deploying a VPC with public and private subnets in two Availability Zones. The workloads in the private subnets need to access the internet for software updates. What is the MOST secure way to provide this internet access?

Quick Answer

The answer is to deploy a NAT gateway in a public subnet and update the private subnets’ route table to point default traffic (0.0.0.0/0) to the NAT gateway. This is the most secure way to provide outbound internet access to private subnets because the NAT gateway allows instances to initiate outbound connections for tasks like software updates, but it drops any unsolicited inbound traffic from the internet, effectively acting as a one-way door. On the AWS Certified Advanced Networking Specialty ANS-C01 exam, this question tests your understanding of how to combine network address translation with route tables to enforce a security boundary—a core concept for designing resilient, multi-AZ VPC architectures. A common trap is confusing a NAT gateway with an internet gateway attached directly to private subnets, which would expose those workloads to inbound attacks. Remember the memory tip: NAT is a “no-answer translator”—it lets you talk out but never listens in.

⚠ Common exam trap

The ANS-C01 exam often tests the misconception that an internet gateway can be used directly for private subnets, but the trap here is that private subnets must never have a default route pointing to an internet gateway because that would make instances publicly routable; instead, a NAT gateway or NAT instance is required to provide outbound-only internet access.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

Deploy a NAT gateway in a public subnet and update the private subnets' route table to point default traffic to the NAT gateway.

A NAT gateway in a public subnet allows instances in private subnets to initiate outbound traffic to the internet (e.g., for software updates) while preventing any unsolicited inbound traffic from the internet. This is the most secure and AWS-recommended method because it uses Source Network Address Translation (SNAT) to mask private IPs behind the NAT gateway's Elastic IP, and it requires only a route table update in the private subnets to direct default traffic (0.0.0.0/0) to the NAT gateway.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • Deploy a NAT gateway in a public subnet and update the private subnets' route table to point default traffic to the NAT gateway.

    Why this is correct

    NAT gateway allows outbound internet access while blocking unsolicited inbound traffic.

  • Set up a VPN connection to an on-premises network with internet access.

    Why it's wrong here

    VPN provides private connectivity, not internet access for the VPC.

  • Use a transit gateway with a VPC attachment and route internet traffic through a centralized inspection VPC.

    Why it's wrong here

    Transit gateway is for inter-VPC routing, not directly for internet access.

  • Attach an internet gateway to the VPC and route the private subnets' traffic to it.

    Why it's wrong here

    This would make the private subnets directly accessible from the internet, reducing security.

Visual reference

Inside (Private) PC-A 10.0.0.1 PC-B 10.0.0.2 NAT Router Outside (Public) 203.0.113.1 Inside Global Server PAT: many private IPs share one public IP via unique port numbers

About these practice questions

This ANS-C01 question is part of Courseiva's 1,621-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

Same concept, more angles

3 more ways this is tested on ANS-C01

These questions test the same concept from different angles. Work through them to make sure you can recognise it however the exam phrases it.

Variation 1. A company is deploying a VPC with public and private subnets in two Availability Zones. They need to ensure that instances in private subnets can access the internet for software updates while remaining unreachable from the internet. Which solution meets these requirements?

easy
  • A.Attach an internet gateway to the private subnets and configure route tables.
  • B.Deploy a NAT Gateway in a public subnet and add a route to the NAT Gateway in the private subnet route tables.
  • C.Use a transit gateway to connect the VPC to the internet.
  • D.Establish a VPN connection to an on-premises network and route traffic through it.

Why B: A NAT Gateway deployed in a public subnet provides outbound-only internet access for instances in private subnets. The private subnet route table directs 0.0.0.0/0 traffic to the NAT Gateway, which translates the private IPs to the NAT Gateway's Elastic IP, allowing internet access while preventing any unsolicited inbound connections from the internet.

Variation 2. A company is deploying a VPC with public and private subnets in two Availability Zones. The public subnets host NAT gateways for outbound internet access from the private subnets. Which configuration ensures that EC2 instances in the private subnets can route traffic to the internet through the NAT gateways?

easy
  • A.Add a route in the public subnet route table pointing to the internet gateway.
  • B.Attach an egress-only internet gateway to the private subnets.
  • C.Create a VPC peering connection between the VPC and the NAT gateway.
  • D.Add a route in the private subnet route table with destination 0.0.0.0/0 targeting the NAT gateway.

Why D: For EC2 instances in private subnets to reach the internet via a NAT gateway, the private subnet route table must include a default route (0.0.0.0/0) pointing to the NAT gateway as the next hop. The NAT gateway resides in a public subnet and translates the private IPs to its own Elastic IP, forwarding traffic to the internet gateway. Without this route, traffic from private instances has no path to the NAT gateway.

Variation 3. A company is deploying a VPC with public and private subnets in two Availability Zones. The private subnets need outbound internet access for software updates but must not be reachable from the internet. Which AWS service should be used to achieve this?

medium
  • A.VPC Peering
  • B.Virtual Private Gateway
  • C.NAT Gateway
  • D.Internet Gateway

Why C: A NAT Gateway enables instances in private subnets to initiate outbound IPv4 traffic to the internet (e.g., for software updates) while preventing the internet from initiating connections back to those instances. It resides in a public subnet with an Elastic IP and uses source network address translation (SNAT) to translate private source IPs to the gateway's public IP, ensuring the private instances remain unreachable from external hosts.

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This ANS-C01 practice question is part of Courseiva's free Amazon Web Services certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the ANS-C01 exam.