A SysOps administrator has created a new subnet within a VPC and launched a test Amazon EC2 instance inside it. The instance is assigned a public IPv4 address, and its security group allows all outbound traffic. However, the administrator is unable to connect to the internet from the instance. Upon checking the subnet's associated route table, the administrator notices it only contains the default local route.
Which route must be added to the route table to enable internet access from this subnet?
- AA route with a destination of pointing to a Gateway VPC Endpoint.
- A route with a destination of pointing to the Internet Gateway (IGW) attached to the VPC.Answer
- CA route with a destination of pointing to a NAT Gateway in a peered VPC.
- DAn outbound Network Access Control List (NACL) rule that allows traffic to ports and while blocking ephemeral ports.
Answer
A route with a destination of pointing to the Internet Gateway (IGW) attached to the VPC.
To enable outbound and inbound internet access for EC2 instances with public IP addresses in a public subnet, the subnet's route table must include a default route () pointing to the Internet Gateway (IGW) attached to the VPC. This allows the VPC to route external traffic to and from the public internet.
Step-by-Step Solution
Key Concept
Configuring a public subnet route table with a route to an Internet Gateway (IGW) to enable internet connectivity for EC2 instances with public IP addresses.