Networking

WireGuard tunnel: large TCP uploads stall after MTU lowered on Linux server — likely PMTU / MSS black hole

Environment

Environment

Ubuntu 22.04 LTS server (kernel 5.15.x) running WireGuard endpoint (wg0). Server route to internet goes through a hardware firewall/router that had MTU reduced from 1420 to 1280 during an MSS/fragmentation change. Clients are Linux and macOS hosts running WireGuard peers.

Symptoms

Symptoms

Large TCP uploads (multi‑MB files, rsync/scp) stall after 40–90s, showing retransmits then timeouts. Small downloads and small HTTP requests succeed. Interactive SSH is OK. Issue appears immediately after the router MTU change and persists until MTU reset.

Observations

Observations

tcpdump on wg0 shows client sending TCP segments with DF set and sizes > 1200B; server sees repeated retransmits and never receives ICMP 'fragmentation needed'. ip route shows wg0 mtu 1420 on peers but tunnel mtu configured to 1280 on server. No ICMPv4 allowed through firewall.

Already attempted

Already attempted

Changed wg0 MTU on server and a client to several values (1280, 1400, 1420) — no consistent fix. Tried disabling TCP offload (ethtool -K) on server NICs; temporarily reverted router MTU to 1420 and large uploads resumed. Enabled iptables TCPMSS clamp on server but used an nftables-only system (iptables rule had no effect).

Question

Question

What diagnostics and reversible fixes will reliably restore large TCP upload throughput over WireGuard without rolling back the router change? How to identify the specific device dropping ICMP 'fragmentation needed' and mitigate in mixed iptables/nftables environments?

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

ICMP 'fragmentation needed' (PMTU) messages being filtered by an intermediate firewall/router after MTU change — endpoints never reduce segment size 90%
No MSS clamp applied on tunnel egress so TCP SYNs advertise too-large MSS and endpoints send large segments that cannot traverse the path 75%
Offload features (GSO/TSO/LRO) on server NIC or peers cause oversized frames that the router drops when encapsulated, appearing like a stall 40%

Summary

Behavior matches a Path MTU Discovery black hole: large TCP segments with DF are sent but an intermediate device (likely the changed router or a firewall) is blocking ICMP 'fragmentation needed' so endpoints never learn lower MTU. WireGuard tunnels encapsulate packets, changing effective path MTU; if endpoints keep a larger MTU while an intermediate enforcer blocks ICMP, large flows stall. Alternatives include missing MSS clamping on egress, NIC offload interacting with encapsulation, or a misconfigured nftables/iptables rule set that fails to adjust MSS for SYN packets.

Suggested Fixes

Diagnostic step 1
Temporarily allow ICMP 'fragmentation needed' (type 3/code 4) through the firewall/router on the path to confirm PMTU is the issue; verify via tcpdump that ICMP messages arrive at endpoint when reproducing large upload.
Diagnostic step 2
Apply MSS clamping for TCP SYNs on the WireGuard egress interface on the router or the WireGuard host (nftables or iptables-mangle TCPMSS --clamp-mss-to-pmtu). For nftables: add a mangle rule to adjust tcp option MSS for SYN packets leaving the tunnel.
Diagnostic step 3
If using nftables and iptables coexistence, implement the clamp using the active packet filter (use nft add rule inet mangle POSTROUTING tcp flags syn tcp option maxseg set rt pmtu or equivalent) or enable iptables-legacy compatibility temporarily and add tcp_mss rule.

Continue troubleshooting

Matched from the title, description and tags