Networking

WireGuard tunnel: large TCP uploads stall after MTU reduction on Debian 12 server

Environment

Environment

Debian 12 host (kernel 6.1), WireGuard peer-to-peer tunnel between datacenter server and remote Ubuntu 22.04 client. wg0 MTU was lowered from 1500→1280 to accommodate nested VPNs and an outer GRE path. Host uses iptables NAT, conntrack, and an Intel 1Gb NIC with default offloads enabled.

Symptoms

Symptoms

Small downloads and short HTTP requests succeed. Large TCP uploads from client to server begin, progress for ~40–70s, then throughput drops to near-zero while TCP remains ESTABLISHED; retransmits increase. Resuming after killing the transfer and restarting sometimes succeeds for a short window.

Observations

Observations

TCP 3-way handshake completes; initial segments appear in tcpdump on wg0 but server-side wireshark shows large aggregated segments from client that exceed outer MTU. Disabling offloads on server NIC immediately allows the long upload to complete. iptables mangle rule for TCP MSS clamping present but had no effect. net.ipv4.tcp_mtu_probing left at default.

Already attempted

Already attempted

Set wg0 MTU to 1280 and 1420 (no consistent fix). Added iptables mangle TCPMSS clamp-mss-to-pmtu on FORWARD chain (no change). Toggled net.ipv4.tcp_mtu_probing=1. Temporarily disabled GSO/GRO/TSO on server NIC (ethtool -K eth0 gso off gro off tso off) — long transfers then completed reliably.

Question

Question

What is causing large TCP uploads to stall after MTU reduction over WireGuard, and how can I fix this reliably without disabling NIC offloads globally?

COMMUNITY RESPONSES

Verified community troubleshooting

0 replies

No answers yet..

Showing 0 of 0 community responses
AI DIAGNOSTICS

Incident analysis

Updated 4w ago• Trouble ID

Most likely causes

Large segment offloading (GSO/GRO/TSO) causes oversized aggregated segments that are not segmented before WireGuard encrypts/encapsulates them — outer packet exceeds MTU and gets dropped or mishandled. 90%
MSS/PMTU mismatch: TCP peers use large MSS and PMTU discovery fails across the encapsulated path (ICMP blocked or not observed), so senders continue sending segments that become too big after encapsulation. 60%
iptables mangle TCPMSS clamping not applied because a raw/conntrack-bypass or FORWARD chain ordering prevents the rule from seeing the pre-NAT packet before encapsulation. 40%

Summary

The symptoms point to large aggregated packets (GSO/GRO/TSO) being formed at the sender or NIC and not being split before WireGuard encryption and encapsulation, producing packets larger than the outer path MTU. Those oversized packets can be dropped or mishandled after encapsulation, causing retransmits and stalls. Disabling offloads on the physical NIC forces proper segmentation and resolves the issue, which implicates hardware offload + tunnel encapsulation interaction. Secondary contributors: MSS/PMTU mismatch and NAT/iptables rules not being applied at the correct hook so clamping is skipped for forwarded/encrypted flows; conntrack-bypass/raw PREROUTING rules can prevent mangle-clamp from seeing traffic. Kernel-level GRO behaviour on tunnel endpoints or a driver bug could also exacerbate the problem.

Suggested Fixes

Diagnostic step 1
Reproduce while capturing both sides: run tcpdump -s0 -w client.pcap on client (wg0) and tcpdump on server physical interface to show packets after encapsulation. Compare segment sizes.
Diagnostic step 2
Temporarily disable offloads on server NIC and WireGuard host to confirm: ethtool -K eth0 gso off gro off tso off; ethtool -K wg0 gso off gro off tso off. Verify long upload completes.
Diagnostic step 3
If disabling offloads fixes it, avoid global disable by: a) set wg0 MTU conservatively (e.g., 1420) and retest; b) add iptables mangle FORWARD -p tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu (ensure it matches the PREROUTING/forwarding path) and confirm it sees forwarded packets (use conntrack -L or tcpdump to verify), or use nftables equivalent.

Continue troubleshooting

Matched from the title, description and tags