NAT Gateway Configuration for Private Subnet Outbound Internet Access
A company has a VPC with a public subnet and a private subnet. An EC2 instance in the private subnet needs to access the internet to download software updates. The company has a NAT gateway in the public subnet. The route table for the private subnet has a default route (0.0.0.0/0) pointing to the NAT gateway. However, the EC2 instance cannot access the internet. The network engineer verifies that the NAT gateway has an Elastic IP, the security group for the EC2 instance allows outbound HTTPS traffic, and the network ACL for the private subnet allows inbound and outbound ephemeral ports. What is the most likely cause of the issue?
Quick Answer
The answer is that the route table for the public subnet does not have a route to an internet gateway. For a NAT gateway to provide outbound internet access from a private subnet, it must itself be able to reach the internet; this requires the public subnet’s route table to include a default route (0.0.0.0/0) pointing to an internet gateway. Without this, the NAT gateway cannot forward traffic beyond the VPC, even though the private subnet’s route table correctly points to the NAT gateway. On the AWS Certified Advanced Networking Specialty ANS-C01 exam, this scenario tests your understanding of the layered routing dependencies in a VPC—a common trap is assuming a NAT gateway automatically has internet access simply because it resides in a public subnet. Remember that a public subnet is defined by having a route to an internet gateway, not just by its name. Memory tip: “NAT needs a path to the outside—if the public subnet lacks an IGW route, your private instance is stuck inside.”
⚠ Common exam trap
The ANS-C01 exam often tests the misconception that the private subnet route alone is sufficient, distracting candidates from verifying the public subnet’s route to the internet gateway, which is a prerequisite for NAT gateway functionality.
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
✓
The route table for the public subnet does not have a route to an internet gateway.
The NAT gateway resides in the public subnet, which must have a route table with a default route (0.0.0.0/0) pointing to an internet gateway (IGW) for the NAT gateway to forward traffic to the internet. Without this route, the NAT gateway cannot reach the IGW, so traffic from the private subnet EC2 instance fails even though the private subnet route is correctly configured. The security group and network ACL settings are irrelevant if the NAT gateway itself lacks internet connectivity.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
The security group attached to the NAT gateway does not allow outbound traffic.
Why it's wrong here
NAT gateways do not have security groups; they are controlled by network ACLs.
- ✓
The route table for the public subnet does not have a route to an internet gateway.
Why this is correct
The public subnet must have a default route to an internet gateway for the NAT gateway to reach the internet.
- ✗
The route table for the private subnet does not have a route to the NAT gateway.
Why it's wrong here
The question states the route table has a default route pointing to the NAT gateway.
- ✗
The NAT gateway does not support UDP traffic.
Why it's wrong here
NAT gateways support TCP, UDP, and ICMP.
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
8 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 has a VPC with a public subnet and a private subnet. An EC2 instance in the private subnet needs to download patches from the internet. The instance is associated with a security group that allows outbound HTTPS (443) traffic. The route table for the private subnet has a default route pointing to a NAT Gateway in the public subnet. Which additional configuration is required to ensure the NAT Gateway can route the traffic?
hard- A.Configure the security group of the NAT Gateway to allow inbound traffic from the private subnet.
- B.Add a route in the private subnet route table to the NAT Gateway's private IP.
- C.Add a route in the public subnet route table to the Internet Gateway.
- ✓ D.Assign an Elastic IP address to the NAT Gateway.
Why D: A NAT Gateway must have an Elastic IP address assigned to it to communicate with the internet. Without an Elastic IP, the NAT Gateway cannot send traffic to the internet or receive return traffic. The private subnet route table correctly points to the NAT Gateway, and the security group on the instance allows outbound HTTPS. The missing configuration is the Elastic IP address, which is required for the NAT Gateway to function.
Variation 2. A company has a VPC with a public subnet and a private subnet. An EC2 instance in the private subnet needs to initiate outbound connections to the internet. The company has a NAT gateway in the public subnet. The NAT gateway has an Elastic IP. The private subnet route table has a default route pointing to the NAT gateway. However, the EC2 instance cannot reach the internet. What is the most likely cause?
hard- A.The security group of the EC2 instance blocks outbound traffic.
- B.The route table in the public subnet does not have a default route to the internet gateway.
- C.The network ACL of the private subnet blocks inbound traffic from the NAT gateway.
- ✓ D.The NAT gateway's Elastic IP is not allowed by the destination's firewall.
Why D: The NAT gateway's Elastic IP is a public IP address that the destination server sees as the source of the outbound traffic. If the destination's firewall (e.g., a security appliance or an internet-based service) explicitly blocks traffic from that Elastic IP, the EC2 instance will be unable to reach the internet, even though the VPC routing and NAT configuration are correct. This is a common scenario when the destination uses IP-based allowlists or blacklists.
Variation 3. A company has a VPC with a public subnet and a private subnet. An EC2 instance in the private subnet needs to download patches from the internet. The company has a NAT gateway in the public subnet. The route table for the private subnet has a route 0.0.0.0/0 pointing to the NAT gateway. However, the EC2 instance cannot reach the internet. Which additional configuration is needed?
hard- A.Assign a public IP address to the EC2 instance.
- B.Attach a security group to the NAT gateway allowing outbound traffic.
- C.Add a route to the NAT gateway in the private subnet's route table for destination 0.0.0.0/0.
- ✓ D.Ensure the public subnet's route table has a route 0.0.0.0/0 pointing to an internet gateway.
Why D: The NAT gateway resides in the public subnet, but it still needs a route to the internet. The public subnet's route table must have a default route (0.0.0.0/0) pointing to an internet gateway (IGW) so that traffic from the NAT gateway can be forwarded to the internet. Without this route, the NAT gateway cannot send traffic beyond the VPC, even though the private subnet's route table correctly points to the NAT gateway.
Variation 4. A company has a VPC with a public subnet and a private subnet. An EC2 instance in the private subnet needs to download software patches from the internet. Which AWS service should be used to provide outbound internet access without allowing inbound traffic?
easy- A.Site-to-Site VPN connection
- B.VPC endpoint
- ✓ C.NAT gateway
- D.Internet gateway
Why C: A NAT gateway enables EC2 instances in a private subnet to initiate outbound IPv4 traffic to the internet (e.g., to download patches) while preventing any unsolicited inbound traffic from the internet. It resides in a public subnet with an Elastic IP and performs source network address translation (SNAT), replacing the private source IP with the gateway's public IP. This satisfies the requirement of outbound-only internet access without exposing the private instances to inbound connections.
Variation 5. A company has a VPC with public and private subnets. An EC2 instance in a private subnet needs to download patches from the internet. The company has a NAT gateway in a public subnet. The EC2 instance can connect to other instances in the VPC but cannot reach the internet. What is the most likely cause?
medium- A.The security group of the EC2 instance blocks outbound HTTPS traffic.
- B.The NAT gateway does not have an Elastic IP address.
- C.The network ACL of the private subnet blocks inbound traffic from the NAT gateway.
- ✓ D.The route table in the private subnet does not have a default route to the NAT gateway.
Why D: For an EC2 instance in a private subnet to reach the internet via a NAT gateway, the private subnet's route table must include a default route (0.0.0.0/0) pointing to the NAT gateway as the target. Without this route, traffic destined for the internet has no path to the NAT gateway, so the instance can communicate within the VPC but cannot reach external hosts. Option D correctly identifies this missing route as the most likely cause.
Variation 6. A company has a VPC with a public subnet and a private subnet. An EC2 instance in the public subnet is configured as a NAT instance. The company wants to replace the NAT instance with a NAT gateway for better availability and maintenance. After creating a NAT gateway in the public subnet and updating the route table of the private subnet, traffic from the private subnet cannot reach the internet. What is the MOST likely cause?
medium- A.The public subnet's route table still points to the NAT instance for internet traffic.
- B.The security group attached to the NAT gateway is blocking outbound traffic.
- C.The private subnet's route table has a route for 0.0.0.0/0 pointing to the NAT instance instead of the NAT gateway.
- ✓ D.The NAT gateway does not have an Elastic IP address associated with it.
Why D: A NAT gateway requires an Elastic IP address to function as a gateway for outbound internet traffic. Without an Elastic IP, the NAT gateway cannot perform source network address translation (SNAT), so instances in the private subnet cannot reach the internet. This is the most likely cause given that the route table update was already performed.
Variation 7. A company has a VPC with a public subnet and a private subnet. They launch an EC2 instance in the private subnet with a private IP only. The instance needs to download patches from the internet. Which configuration is required?
medium- A.Launch a NAT instance in the private subnet and configure source/destination check.
- B.Create a VPC endpoint for the patch service.
- ✓ C.Create a NAT gateway in the public subnet and add a default route to the NAT gateway in the private subnet's route table.
- D.Attach an internet gateway to the VPC and add a default route to it in the private subnet's route table.
Why C: A NAT gateway in the public subnet provides outbound internet access for instances in the private subnet while preventing inbound connections from the internet. By adding a default route (0.0.0.0/0) in the private subnet's route table pointing to the NAT gateway, traffic from the EC2 instance destined for the internet is forwarded to the NAT gateway, which then uses its Elastic IP to communicate with the internet. This allows the instance to download patches without requiring a public IP or direct internet gateway access.
Variation 8. A company has a VPC with public and private subnets. The private subnets need to access the internet for software updates. The company wants to ensure that traffic can only go out to the internet and not be initiated from the internet. Which configuration should be used?
medium- A.Attach an Internet Gateway to the private subnets
- ✓ B.Deploy a NAT Gateway in a public subnet and update the private subnet route table
- C.Set up a VPN connection to an on-premises network
- D.Create a VPC endpoint for S3
Why B: A NAT Gateway deployed in a public subnet with an Elastic IP allows private subnet instances to initiate outbound traffic to the internet (e.g., for software updates) while preventing any unsolicited inbound connections from the internet. The private subnet’s route table must include a default route (0.0.0.0/0) pointing to the NAT Gateway, which translates the private source IP to the gateway’s Elastic IP for return traffic. This meets the requirement of outbound-only internet access without exposing private instances to inbound initiation.
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.