Lesson 1 of 5 Network Troubleshooting and Monitoring

Troubleshooting VPC Connectivity Systematically

This lesson sets out the fixed order in which to check each component along a network path, which solves connectivity problems faster than guessing, and the most common faults.

Learning outcomes

After completing this lesson, you will be able to:

  • Check each hop along the path in both directions.
  • Recognise common connectivity faults.

A systematic path check

For traffic from a source to a destination, check each hop in both directions. The following sequence covers almost every VPC connectivity problem.

  1. DNS

    Does the name resolve to the expected address (private hosted zone associations, Resolver rules, endpoint private DNS)?

  2. Source security group

    Outbound rules allow the destination and port.

  3. Source subnet NACL

    Outbound allows the traffic, and inbound allows the return traffic on ephemeral ports.

  4. Source route table

    A route to the destination via the right target (local, IGW, NAT, peering, TGW, endpoint, VGW), and the target is available.

  5. Intermediate devices

    NAT gateway in a public subnet with an IGW route; transit gateway association and routes; firewall endpoints with symmetric routing.

  6. Destination subnet NACL

    Inbound and outbound (ephemeral) rules.

  7. Destination security group

    Inbound rule for the source and port.

  8. Destination host

    Service listening on the port, OS firewall, correct binding address.

  9. Internet access

    Public IP or Elastic IP on the instance (or NAT), IGW route, and the destination's own restrictions.

The following diagram shows the hops in order.

A systematic path check from source to destination: DNS resolution, the source security group's outbound rules, the source subnet's NACL in both directions, the source route table, intermediate devices such as NAT gateways, transit gateways and peering, the destination NACL, the destination security group, and finally the destination host's listener and firewall.
Checking in order avoids changing a security group when the real fault is a route.
Put in order

Checking a path

Exam skills 5.3.1

Put the checks for a failed connection between two instances in a sensible order.

Log in to try this activity Interactive activities are free with an account.

Common faults

The following table lists faults that appear repeatedly in exam scenarios.

SymptomLikely cause
Instance in public subnet unreachable from internetNo public IP, no IGW route, or SG/NACL blocks
Private instance cannot reach internetNo NAT route, NAT in private subnet, or NAT in failed AZ
Inbound connection times out but SG allows itNACL inbound or outbound ephemeral rule missing
Peered VPCs cannot communicateRoute missing on one side, overlapping CIDR, or SG does not allow peer CIDR/SG
VPC A reaches C through B's peeringImpossible: peering is non-transitive
TGW-attached VPCs cannot communicateAttachment not associated, no propagation/static route, or VPC route to TGW missing
Interface endpoint unreachableEndpoint SG blocks 443, private DNS disabled, wrong subnet/AZ
S3 access through gateway endpoint deniedEndpoint policy or bucket policy aws:SourceVpce mismatch, or route table not associated
Troubleshooting scenario

Connectivity faults

Exam skills 5.3.1

Find the fault behind each connectivity problem.

Log in to try this activity Interactive activities are free with an account.
Worked example

One subnet cannot reach a peer VPC

Application servers in VPC B (10.2.0.0/16) reach a service in VPC A (10.1.0.0/16) through a transit gateway, but a reporting job running in B's database subnets times out connecting to the same service. Both attachments are associated with one TGW route table that has propagated routes for both CIDRs, and VPC A's route tables send 10.2.0.0/16 to the transit gateway. Reachability Analyzer from the reporting instance to the service names the blocking component: the route table associated with B's database subnets has no route for 10.1.0.0/16, while the application subnets' route table does. Adding the route to the database subnets' route table fixes it, which shows why every subnet's route table must be checked, not just one per VPC.

Check yourself

Why do NACLs need ephemeral port rules?

Show answer

They are stateless, so return traffic must be allowed explicitly.

Exam Tips

Remember for the exam

  • Check DNS, security groups, NACLs (both directions), route tables and the destination host in order.
  • NACLs need ephemeral port rules for return traffic.
  • Every subnet's route table needs the route, not just one in the VPC.
  • Transit gateway: association, propagation or static route, and VPC routes to the TGW.