Question

Difficulty: MediumVPC Connectivity and Routing Troubleshooting

A SysOps Administrator has deployed an Amazon EC2 instance in a newly created subnet. The instance has been assigned a public IPv4 address, and its security group is configured to allow all outbound traffic and inbound SSH traffic from the administrator's IP address. However, the administrator is unable to establish an SSH connection to the instance, and the instance cannot reach external internet-based repositories. Which two configurations should the administrator verify to resolve this connectivity issue?

  1. Confirm that the subnet's route table contains a route for 0.0.0.0/00.0.0.0/0 targeting the Internet Gateway.Answer
  2. Confirm that the subnet's network access control list (network ACL) allows outbound traffic on ephemeral ports 1024655351024-65535.Answer
  3. C
    Confirm that the instance's security group allows inbound traffic on ephemeral ports 1024655351024-65535 from the internet.
  4. D
    Confirm that a Gateway VPC endpoint is associated with the subnet's route table.
  5. E
    Confirm that the EC2 instance's IAM role includes the `iam:PassRole` permission.

Answer

Verify that the subnet's route table contains a route for 0.0.0.0/00.0.0.0/0 targeting the Internet Gateway, and verify that the subnet's network ACL allows outbound traffic on ephemeral ports 1024655351024-65535.
For an EC2 instance in a VPC to communicate with the internet, it must be located in a public subnet, which is defined by having a route table entry pointing 0.0.0.0/00.0.0.0/0 to an Internet Gateway. Additionally, because Network ACLs are stateless, outbound rules must explicitly permit return traffic to client connections on ephemeral ports (1024655351024-65535).

Step-by-Step Solution

1
Check the routing configuration for the subnet.
Ensure there is a route for 0.0.0.0/00.0.0.0/0 that has a target of the Internet Gateway attached to the VPC, making it a public subnet.
Without a route targeting the Internet Gateway, the VPC routing table does not know where to send traffic destined for external internet-based repositories or how to route response traffic back to external clients.
2
Examine the Network Access Control List (NACL) rules associated with the subnet.
Ensure the inbound rules allow traffic on port 2222 and outbound rules allow return traffic on ephemeral ports (1024655351024-65535).
Since Network ACLs are stateless, they evaluate inbound and outbound traffic independently. A missing outbound rule for ephemeral ports will drop return packets, causing connection timeouts even if the route table and security groups are configured correctly.

Key Concept

VPC public routing requires a route to an Internet Gateway, and stateless Network ACLs require explicit configuration of outbound ephemeral ports to allow response traffic.
Rate this question