Soru

Zorluk: OrtaVPC Connectivity and Routing Troubleshooting

A SysOps administrator has launched an Amazon EC2 instance in a newly created private subnet (10.0.2.0/2410.0.2.0/24) to run a database client. The client needs to connect to an external API on the internet. The administrator has deployed a NAT Gateway in another subnet (10.0.1.0/2410.0.1.0/24) within the same VPC. However, the EC2 instance cannot establish any connection to the internet. Which of the following configuration changes are required to resolve this connectivity issue? (Select TWO.)

  1. Add a route in the route table associated with the database client's subnet (10.0.2.0/2410.0.2.0/24) with a destination of 0.0.0.0/00.0.0.0/0 pointing to the NAT Gateway.Cevap
  2. Add a route in the route table associated with the NAT Gateway's subnet (10.0.1.0/2410.0.1.0/24) with a destination of 0.0.0.0/00.0.0.0/0 pointing to the Internet Gateway.Cevap
  3. C
    Associate the Internet Gateway directly with the route table of the database client's subnet (10.0.2.0/2410.0.2.0/24) as the target for 0.0.0.0/00.0.0.0/0.
  4. D
    Modify the Network ACL associated with the NAT Gateway's subnet (10.0.1.0/2410.0.1.0/24) to allow inbound traffic on ports 8080 and 443443 but deny all outbound ephemeral ports (1024655351024-65535).
  5. E
    Create a gateway VPC endpoint and associate it with the route table of the database client's subnet (10.0.2.0/2410.0.2.0/24) to route all outbound internet traffic.

Cevap

Add a route in the route table associated with the database client's subnet pointing to the NAT Gateway, and add a route in the route table associated with the NAT Gateway's subnet pointing to the Internet Gateway.
To allow instances in a private subnet to access the internet, the routing must be configured in two stages. First, the route table for the private subnet where the client resides must direct all outbound traffic (0.0.0.0/00.0.0.0/0) to the NAT Gateway. Second, the NAT Gateway itself must be located in a public subnet, which requires a route table with a route directing outbound traffic (0.0.0.0/00.0.0.0/0) to the Internet Gateway.

Adım Adım Çözüm

1
Examine the routing path from the private subnet to the internet.
The private subnet lacks a route to direct outbound traffic to the NAT Gateway.
Outbound internet traffic (0.0.0.0/00.0.0.0/0) must first be directed to the NAT Gateway for translation.
2
Examine the routing path from the NAT Gateway's subnet to the internet.
The NAT Gateway's subnet lacks a route to the Internet Gateway.
For a NAT Gateway to access the internet, its hosting subnet must be public, meaning it requires a route targeting the Internet Gateway.

Anahtar Kavram

Two-tier routing setup is required for private instances accessing the internet via a NAT Gateway: private subnet routes to the NAT Gateway, and the NAT Gateway's subnet routes to the Internet Gateway.
Bu soruyu puanla