Interview Prep/Networking/Cloud networking: VPC, firewalls, NAT, VPN and proxies

Two VPCs are attached to a Transit Gateway, but traffic between them fails.

IntermediateTroubleshootingCloud networking: VPC, firewalls, NAT, VPN and proxies
Answer

Likely causes → Three places to get right: (1) each VPC's subnet route tables need a route to the other CIDR via tgw-xxxx; (2) each attachment must be associated with a TGW route table; (3) that TGW route table needs routes (propagated or static) to the other attachment. Plus the TGW attachment must have a subnet in each AZ the traffic uses.

Diagnose →

aws ec2 get-transit-gateway-route-table-associations --transit-gateway-route-table-id <rtb>
aws ec2 search-transit-gateway-routes --transit-gateway-route-table-id <rtb> \
  --filters Name=type,Values=static,propagated
aws ec2 describe-route-tables --filters Name=vpc-id,Values=<vpc> --query 'RouteTables[].Routes[?TransitGatewayId]'

Reachability Analyzer and TGW Flow Logs help confirm which hop drops.

Fix → Add the missing VPC route, association or propagation; add attachment subnets in missing AZs.

Prevent → Use TGW Network Manager / Route Analyzer and codify TGW route tables, especially when segmenting prod and non-prod.

All Networking questions Roadmap: Networking for DevOps

More on Cloud networking: VPC, firewalls, NAT, VPN and proxies