Networking

WireGuard tunnel stalls on large TCP uploads after MTU change on Linux server

astridapps
1mo ago
Environment

Environment

Debian 11 host (kernel 5.10), WireGuard tools v1.0.202, server behind NAT on home ISP, clients: Ubuntu 22.04 laptop and macOS 13.4; wg0 MTU set to 1420 by admin to avoid fragmentation over VPN-over-DSL link.

Symptoms

Symptoms

Small HTTP requests, DNS lookups and ssh traffic work normally. Large uploads via rsync/scp or sustained iperf3 TCP send stall after a few MB; retransmits increase and throughput falls to near zero until connection times out. Short flows complete fine.

Observations

Observations

tcpdump on server shows the client sending large segments that are not ACKed; retransmits and zero-window not observed from server side. No ICMP 'fragmentation needed' messages seen. ip route shows path MTU 1500 on host, wg0 MTU 1420. Kernel TCP MSS remains high on one endpoint. Disabling TSO/SG offloads had no visible effect. Temporary lowering of wg0 MTU to 1300 improved but did not eliminate stalls.

Already attempted

Already attempted

Lowered wg0 MTU to 1300 (partial improvement). Added iptables mangle TCPMSS clamp rule manually (worked while active). Disabled TSO/SG/ GSO on physical NIC. Rebooted router and clients. Tried toggling Keepalive. No persistent solution; problem recurs after intermittent network changes.

Question

Question

What is most likely causing large TCP uploads to stall over WireGuard after MTU changes and how can I make a reliable, reversible fix so large flows don't hang (without permanently disabling PMTU)?

COMMUNITY RESPONSES

Verified community troubleshooting

0 replies

No answers yet..

Showing 0 of 0 community responses
AI DIAGNOSTICS

Incident analysis

Updated 1mo ago• Trouble ID

Most likely causes

PMTU black-hole because an intermediate firewall/NAT blocks ICMP 'fragmentation needed' so TCP endpoints never learn to lower segment size 90%
No TCP MSS clamping on server or VPN gateway; sender still uses large MSS and relies on PMTU discovery 70%
NIC offload or kernel segmentation/encapsulation bug causing oversized tunneled frames that are dropped by downstream device 40%

Summary

Behavior matches a PMTU/MSS black-hole: packets exceed path MTU and intermediate device drops them while blocking ICMP 'fragmentation needed', so endpoints never reduce segment size. The temporary mangle TCPMSS clamp fixed it while present because it forces senders to use smaller MSS. Lowering wg0 MTU below worst-case path MTU can help but is a blunt tool. Other possible contributors include NAT/firewall dropping fragments, kernel offload/segmentation bugs causing oversized frames, or asymmetric routing leading to wrong PMTU estimation.

Suggested Fixes

Diagnostic step 1
Temporarily enable TCP MSS clamping on the host to verify fix: iptables -t mangle -A FORWARD -p tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu (or adapt to INPUT/OUTPUT depending on topology). Test with iperf3/rsync.
Diagnostic step 2
If MSS clamp works, persist the rule (iptables-persistent, nftables equivalent) or add to systemd-networkd/Netfilter startup scripts.
Diagnostic step 3
Alternatively set wg0 MTU to a conservative value (e.g. 1280) on both ends and test; if fine, adjust upward until you see issues to find safe MTU.

Continue troubleshooting

Matched from the title, description and tags