Networking

Large TCP uploads stall over WireGuard after MTU lowered on Linux server

Swoop
1mo ago
Environment

Environment

Ubuntu 22.04 server running WireGuard 1.0.20220411 on kernel 5.15. Host MTU was lowered from 1500->1400 after migration. Peers: mobile clients and a remote Linux gateway. No hardware offload changes were made on the clients.

Symptoms

Symptoms

Small requests (HTTP GET, SSH) work normally. Large HTTPS uploads (S3 multipart, rsync over TCP) start then stall with near-zero throughput after ~30–90s. TCP shows retransmits and long stalls; transfers eventually time out.

Observations

Observations

iperf3 single-stream shows normal throughput at 64KB but stalls for 1MB streams. tcpdump on server's wg0 shows steady UDP keepalive and the inner TCP handshake/stream, but no ICMP 'fragmentation needed' messages observed. Firewall has default rules; upstream router filters ICMP outbound.

Already attempted

Already attempted

Increased WireGuard MTU to 1420 then 1380 on server and a client — transfers improved but not consistently. Restarted wg and netfilter. Added iptables rule to clamp MSS on FORWARD chain but used wrong chain for client traffic and didn't persist. Rebooted server.

Question

Question

What's the most likely cause of large-TCP stalls after MTU was lowered, and which reversible steps will reliably restore large-transfer throughput without forcing all peers to reconfigure?

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' blocked on path (PMTU discovery fails) 85%
No MSS clamping for routed/forwarded TCP connections, causing peers to use segments larger than tunnel MTU 75%
WireGuard MTU misconfigured (endpoint MTU > underlying path MTU) or inconsistent MTU between peers 60%

Summary

Symptoms point to a PMTU black hole or MSS/fragmentation mismatch. When MTU is reduced on one endpoint, Path MTU Discovery relies on ICMP 'fragmentation needed' (or explicit clamping) to adjust. If ICMP is blocked or intermediate devices drop fragmented UDP packets, TCP flows encapsulated inside WireGuard can exceed the effective MTU and stall. Kernel offloads (GSO/TSO/SG) may produce large skbs that exceed MTU and get dropped. Incorrect MSS clamp placement or missing rules on the routing/forwarding path can leave TCP peers using too-large segments.

Suggested Fixes

Diagnostic step 1
Temporarily lower wg0 MTU on server and one client to a conservative value (e.g., 1350) and test large uploads to verify PMTU is the issue.
Diagnostic step 2
On the router/firewall, allow ICMP Type 3 Code 4 ('fragmentation needed') in both directions; validate via tcpdump while reproducing transfer.
Diagnostic step 3
Add an MSS-clamp rule that matches forwarded TCP SYN packets: iptables -t mangle -A FORWARD -p tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu (or nft equivalent); persist across reboots.

Continue troubleshooting

Matched from the title, description and tags