Debugging an MTU black hole where HTTPS stalls but DNS works fine
Two developers on the same VPN reported that the internal wiki would load its HTML and then hang on CSS. curl -v showed "Connected to wiki.internal" and then nothing. Small API calls worked. Nobody suspected MTU until the third day, which is embarrassing because the signs were all there.
## The symptoms were inconsistent by size
$ curl -v --max-time 10 https://wiki.internal/assets/app.css
* Trying 10.8.0.12:443...
* Connected to wiki.internal (10.8.0.12) port 443
* ALPN, offering h2
> GET /assets/app.css HTTP/2
> Host: wiki.internal
< HTTP/2 200
< content-length: 184320
curl: (28) Operation timed out after 10000 milliseconds with 0 bytes received
A 180KB file never arrived. A 400-byte JSON endpoint returned instantly. Same host, same TLS session, same route. That size dependence is the classic signature of a packet that is too big to fit but has the DF bit set, so nobody fragments it and nobody sends an ICMP error back.
## Proving it with ping
The tunnel interface had MTU 1420, because WireGuard adds 60 bytes of overhead to the underlay's 1500. From the client:
$ ping -M do -s 1392 10.8.0.12
PING 10.8.0.12 (10.8.0.12) 1392(1420) bytes of data.
ping: local error: Message too long, mtu=1500
That one failed locally because I tested against the wrong interface path. The useful test was against the tunnel address with a size above the tunnel MTU minus headers:
$ ping -M do -s 1450 10.8.0.12
PING 10.8.0.12 (10.8.0.12) 1450 bytes of data.
^C
--- 10.8.0.12 ping statistics ---
3 packets transmitted, 0 received, 100% packet loss, time 2045ms$ ping -M do -s 1372 10.8.0.12
3 packets transmitted, 3 received, 0% packet loss, time 2051ms
1392 bytes of payload plus 28 bytes of ICMP/IP header equals 1420, so 1372 is the largest that fits. The 1450 test died silently. That is the black hole: the ICMP "fragmentation needed" message was being dropped by a firewall rule on the intermediate box.
## What tcpdump showed
On the tunnel server, watching the client's address:
$ sudo tcpdump -ni wg0 'host 10.8.0.7 and icmp'
14:22:03.112 IP 10.8.0.12 > 10.8.0.7: ICMP 10.8.0.12 unreachable - need to frag (mtu 1420), length 556
14:22:03.114 IP 10.8.0.12 > 10.8.0.7: ICMP 10.8.0.12 unreachable - need to frag (mtu 1420), length 556
The server was sending the right ICMP message. It never reached the client because a ufw deny icmp rule on another hop dropped inbound ICMP. So PMTUD could not work. TLS always sends full-size records, so it hit the ceiling immediately.
## The fix
Two changes. First, clamp MSS on the forwarding box so TCP never offers a segment that big:
sudo iptables -t mangle -A FORWARD \
-p tcp --tcp-flags SYN,RST SYN \
-j TCPMSS --clamp-mss-to-pmtu
Second, lower the WireGuard MTU in the client config to leave margin for the underlay:
[Interface]
Address = 10.8.0.7/32
MTU = 1380
After reconnecting, the same CSS file came back in one piece. I also allowed the specific ICMP type back through the firewall, but the MSS clamp is what made it work reliably, since you cannot always control every hop.
## Why it took two days
Because I kept testing with curl and dig, both of which make small requests by default, and because everything "worked" in the sense that connections established. If a connection succeeds but large transfers hang, test with ping -M do before you touch the application.