Question

Difficulty: MediumVPC Connectivity and Routing Troubleshooting

An organization has set up a VPC with a public subnet (10.0.1.0/2410.0.1.0/24) and a private subnet (10.0.2.0/2410.0.2.0/24). A NAT gateway is deployed in the public subnet to grant internet access to resources in the private subnet. An Amazon EC2 instance is launched in the private subnet, but it cannot connect to any external internet repositories to download updates. Which of the following routing configuration steps are required to establish this connectivity? (Select TWO.)

  1. Add a route to 0.0.0.0/00.0.0.0/0 in the private subnet's route table that targets the NAT gateway.Answer
  2. Add a route to 0.0.0.0/00.0.0.0/0 in the public subnet's route table that targets the Internet Gateway.Answer
  3. C
    Add a route to 0.0.0.0/00.0.0.0/0 in the private subnet's route table that targets the Internet Gateway directly.
  4. D
    Configure the security group of the NAT gateway to allow outbound HTTPS traffic to 0.0.0.0/00.0.0.0/0.
  5. E
    Modify the private subnet's network ACL outbound rules to specify the NAT gateway's resource ID as the destination.

Answer

To resolve the internet connectivity issue for the EC2 instance in the private subnet, you must add a route to 0.0.0.0/00.0.0.0/0 in the private subnet's route table targeting the NAT gateway, and ensure the public subnet's route table has a route to 0.0.0.0/00.0.0.0/0 targeting the Internet Gateway.
The correct configuration requires two routing entries: first, the private subnet's route table must route all non-local traffic (0.0.0.0/00.0.0.0/0) to the NAT gateway; second, the public subnet's route table (where the NAT gateway resides) must route all non-local traffic (0.0.0.0/00.0.0.0/0) to the Internet Gateway. Together, these routes form the complete outbound path to the internet.

Step-by-Step Solution

1
Inspect the route table associated with the private subnet containing the EC2 instance.
Identify that the private subnet lacks a route to send internet-bound traffic (0.0.0.0/00.0.0.0/0) to the NAT gateway.
Traffic destined for the internet from the private subnet must be explicitly routed to the NAT gateway.
2
Add a default route to the private subnet's route table targeting the NAT gateway.
Traffic from the EC2 instance is now successfully sent to the NAT gateway's elastic network interface.
This establishes the first leg of the route from the private resource to the NAT gateway.
3
Inspect the route table associated with the public subnet where the NAT gateway is deployed.
Verify if the public subnet has a route to the Internet Gateway.
The NAT gateway resides in the public subnet and requires a route targeting the Internet Gateway to communicate with external endpoints.
4
Add a route to 0.0.0.0/00.0.0.0/0 targeting the Internet Gateway in the public subnet's route table if it is missing.
The NAT gateway can successfully send translated traffic to the internet and receive return traffic.
This completes the end-to-end path for outbound internet access.

Key Concept

Two-tier routing architecture with NAT Gateway and Internet Gateway
Rate this question