NAT Gateway for Private Subnet Internet Access
A company is deploying a new VPC with both public and private subnets. The public subnet hosts an internet-facing Application Load Balancer (ALB), and the private subnet hosts EC2 instances running a web application. The EC2 instances need to download updates from the internet, but they must not be directly accessible from the internet. Which combination of steps should a network engineer implement to meet these requirements?
Quick Answer
The correct answer is to create a NAT Gateway in a public subnet and add a default route (0.0.0.0/0) to it in the private subnet’s route table. This works because the NAT Gateway, residing in a public subnet with an Elastic IP, enables outbound internet connectivity for private instances while blocking any unsolicited inbound traffic, as it only translates responses to initiated requests. On the AWS Certified Advanced Networking Specialty ANS-C01 exam, this scenario tests your understanding of how to architect outbound-only internet access for private subnets, often appearing in questions about secure VPC designs or hybrid networking. A common trap is confusing a NAT Gateway with a NAT Instance or assuming a NAT Gateway can be placed in a private subnet—it cannot, as it requires a public subnet for its Elastic IP. For a memory tip, remember: NAT Gateway lives in the public subnet, but its route lives in the private subnet’s route table.
⚠ Common exam trap
AWS often tests the misconception that an Internet Gateway in a private subnet's route table provides outbound-only access, but in reality, an Internet Gateway enables bidirectional traffic, making instances publicly reachable if they have public IPs or if the route is present.
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
✓
Create a NAT Gateway in a public subnet, and add a default route (0.0.0.0/0) to the NAT Gateway in the private subnet's route table.
A NAT Gateway in a public subnet allows EC2 instances in private subnets to initiate outbound traffic to the internet (e.g., for updates) while preventing any unsolicited inbound connections from the internet. Adding a default route (0.0.0.0/0) to the NAT Gateway in the private subnet's route table directs all outbound internet traffic through the NAT Gateway, which translates the private IPs to the NAT Gateway's Elastic IP. This meets the requirement of internet access for downloads without direct internet accessibility.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
Create a NAT Gateway in a public subnet, and add a default route (0.0.0.0/0) to the NAT Gateway in the private subnet's route table.
Why this is correct
This allows outbound internet access while blocking inbound connections.
- ✗
Launch a proxy server in the public subnet and configure the private instances to use it for outbound traffic.
Why it's wrong here
A proxy server in the public subnet does not provide a managed, scalable outbound gateway; the correct solution requires a NAT gateway or NAT instance to enable private instances to reach the internet while blocking inbound traffic. This option is tempting because a proxy can forward HTTP/HTTPS requests, which works for web-based updates, but it fails because it introduces a single point of failure and requires manual configuration of proxy settings on each EC2 instance, whereas a NAT device operates transparently at the network layer without application-level changes.
- ✗
Set up a VPN connection to an on-premises network and route all internet traffic through the VPN.
Why it's wrong here
This does not provide direct internet access; it routes traffic to on-premises.
- ✗
Attach an Internet Gateway to the VPC and add a default route (0.0.0.0/0) to the Internet Gateway in the private subnet's route table.
Why it's wrong here
This would make the private instances reachable from the internet, violating the requirement.
Visual reference
Go deeper
Related to this question
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 →
Same concept, more angles
2 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 both public and private subnets. They have an EC2 instance in a private subnet that needs to access the internet for software updates. Which AWS service should be placed in a public subnet to enable this?
easy- A.Internet gateway
- B.VPC endpoint
- C.Direct Connect virtual interface
- ✓ D.NAT gateway
Why D: A NAT gateway is correct because it enables EC2 instances in a private subnet to initiate outbound connections to the internet (e.g., for software updates) while preventing the internet from initiating inbound connections to those instances. The NAT gateway must be placed in a public subnet with an associated Internet Gateway to translate private IP addresses to the public IP of the NAT gateway for outbound traffic.
Variation 2. A company is setting up a VPC with both public and private subnets. The private subnets need outbound internet access for software updates. Which component is required to enable this?
easy- ✓ A.A NAT gateway in a public subnet.
- B.A VPN connection to an on-premises network that has internet access.
- C.A VPC peering connection to a VPC that has internet access.
- D.An internet gateway attached to the VPC with a route in the private subnet's route table pointing to the internet gateway.
Why A: A NAT gateway in a public subnet is required to enable outbound internet access for private subnets. The NAT gateway resides in a public subnet with an Internet Gateway (IGW) route, and private subnet route tables direct default traffic (0.0.0.0/0) to the NAT gateway's elastic network interface. This allows instances in private subnets to initiate outbound connections (e.g., for software updates) while preventing unsolicited inbound traffic from the internet.
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.