An EC2 instance in a private subnet hangs on `apt-get update` at `Connecting to archive.ubuntu.com`.
BeginnerTroubleshootingCloud networking: VPC, firewalls, NAT, VPN and proxies
Answer
Likely causes → The private subnet's route table has no 0.0.0.0/0 route to a NAT gateway, the NAT gateway itself sits in a private subnet (it must be in a public subnet with an IGW route), or the instance SG/NACL blocks outbound 80/443.
Diagnose →
aws ec2 describe-route-tables --filters Name=association.subnet-id,Values=<subnet-id> \
--query 'RouteTables[].Routes'
aws ec2 describe-nat-gateways --nat-gateway-ids <nat-id> --query 'NatGateways[0].[State,SubnetId]'
curl -m 5 -sI https://archive.ubuntu.com # from the instance
Fix → Add 0.0.0.0/0 → nat-xxxx to the private route table, place the NAT gateway in a public subnet, and allow outbound HTTPS in the SG.
Prevent → Build VPCs from a tested Terraform module; add a VPC endpoint for S3 so package mirrors on S3 don't need NAT at all.
More on Cloud networking: VPC, firewalls, NAT, VPN and proxies
A new EC2 instance in a "public" subnet can't be reached over SSH from the internet; the SG allows port 22 from your IP.BeginnerThe SG allows inbound 443 and the app works from inside the VPC, but internet clients time out. The subnet NACL allows inbound 443.IntermediateA VPC peering connection is `Active`, but instances in the two VPCs can't ping each other.BeginnerALB targets are `unhealthy` with reason `Target.Timeout`, and VPC Flow Logs show `REJECT` from the ALB's IPs to the instances.BeginnerTwo VPCs are attached to a Transit Gateway, but traffic between them fails.IntermediateAn AWS Site-to-Site VPN tunnel stays `DOWN`, and the on-prem firewall logs show `NO_PROPOSAL_CHOSEN`.Intermediate