SSH and small HTTP requests work across a VPN / Transit Gateway, but large file transfers and TLS handshakes hang.
AdvancedTroubleshootingVPC and Connectivity
Answer
Likely causes → An MTU mismatch. Instances use jumbo frames (9001 MTU) inside the VPC, but Site-to-Site VPN supports at most 1446 bytes and Transit Gateway 8500. Small packets fit; big ones need fragmentation. Path MTU Discovery fails because ICMP "fragmentation needed" (type 3 code 4) is blocked by a security group, NACL or on-prem firewall.
Diagnose →
ip link show eth0 | grep mtu # 9001 on most Nitro instances
ping -M do -s 1418 10.20.0.15 # 1418 + 28 = 1446, should pass
ping -M do -s 1472 10.20.0.15 # fails => MTU is the problem
tracepath 10.20.0.15 # shows the pmtu hop by hop
aws ec2 describe-security-groups --group-ids sg-0abc --query 'SecurityGroups[].IpPermissions[?IpProtocol==`icmp`]'
Fix →
- Allow inbound ICMP type 3 code 4 (Destination Unreachable / Fragmentation Needed) in the SGs and NACLs on both sides
- Enable TCP MSS clamping on the customer gateway (for example MSS 1379 for IPsec)
- As a short-term workaround, lower the instance MTU:
sudo ip link set dev eth0 mtu 1400
Prevent → Treat ICMP unreachable as required traffic in baseline SGs, and document per-path MTU (VPN 1446, TGW 8500, internet 1500).
More on VPC and Connectivity
`ssh: connect to host 3.250.1.1 port 22: Connection timed out`. Walk the checks.Beginner`ssh: connect to host ... port 22: Connection refused`. How is it different from a timeout?Beginner`Permission denied (publickey)` on a new EC2 instance.IntermediatePrivate instances cannot reach the internet; `curl: (28) Connection timed out after 10000 milliseconds`.IntermediateNAT gateway shows `ErrorPortAllocation` in CloudWatch and connections drop.IntermediateVPC peering is `active` but ping fails.Intermediate