PMTU black holes: diagnosing stalled handshakes with three packets
The symptom is always the same: the TCP handshake completes, the first small request succeeds, and then the connection hangs forever without an error. That is a path MTU black hole, not a firewall.
The three probes
Start with the largest payload the local link allows, then binary-search down. ICMP echo with the DF bit set is the cheapest instrument available; tracepath finds the hop that stops answering, which tells you where the tunnel or PPPoE segment begins.
# largest unfragmented payload the path will carry
ping -M do -s 1472 -c 2 198.51.100.7
# walk the path and print the MTU it discovers
tracepath -n 198.51.100.7
# confirm on the wire that the SYN-ACK advertises a smaller MSS
tcpdump -ni eth0 -c 4 'tcp[tcpflags] & tcp-syn != 0' -vv
1472 bytes of payload plus 28 bytes of IP and ICMP headers is 1500. If that fails but 1400 succeeds, the path carries slightly less than a full Ethernet frame — the classic signature of a tunnel that does not propagate ICMP fragmentation needed.
Why it survives
Path MTU discovery depends on routers returning ICMP type 3 code 4. Overlay networks, some cloud security groups and a surprising number of consumer CPEs drop that ICMP silently. The sender keeps retransmitting a full-size segment that is discarded at the tunnel ingress, and because TCP interprets the silence as loss, it retransmits into the same wall.
curl -I succeeds and curl -d @4k.bin hangs, stop looking at the firewall rules.Fixing it on our side
Where the peer cannot be changed, clamp the MSS on the egress interface. This rewrites the advertised MSS in SYN and SYN-ACK so neither end ever emits an oversized segment.
iptables -t mangle -A FORWARD -p tcp --tcp-flags SYN,RST SYN \
-j TCPMSS --clamp-mss-to-pmtu
# persist across reboots
apt-get install -y iptables-persistent
netfilter-persistent save
Clamping is a workaround with a real cost: every connection on that interface pays a slightly smaller window. It is still preferable to a service that hangs, but the correct fix belongs at the tunnel ingress, where ICMP should have been passed through in the first place.