MTU: maximum transmission unit and path MTU discovery (PMTUD)
Updated November 1, 2026
MTU is the maximum IP packet size an interface will send. PMTUD finds the minimum along a path using ICMP "Fragmentation Needed". If ICMP is filtered, large packets are blackholed. MSS clamping in iptables/nftables is the standard fix on VXLAN/IPsec tunnels.
Why MTU matters
Maximum Transmission Unit (MTU) is the largest IP packet an interface will send in one piece. On standard Ethernet that is 1500 bytes (the payload of an frame).
When a packet exceeds the MTU, either the kernel fragments it at the IP layer or the sender must use a smaller packet. In IPv6, kernel fragmentation by intermediate nodes is forbidden by the spec; only the source may fragment, and PMTUD is mandatory.
A broken PMTUD is a common cause of strange production failures: SSH works, apt update hangs, git clone dies mid-transfer. The pattern is always the same: small packets pass, large packets do not.
Where the typical values come from
| Medium | MTU | Notes |
|---|---|---|
| Ethernet (standard) | 1500 | minus 18 bytes of L2 header from a 1518-byte frame |
| Jumbo frame | 9000 | data center; all switches must support it |
| PPPoE (DSL) | 1492 | minus 8 bytes PPPoE header |
| OpenVPN UDP | ~1400 | TLS+UDP overhead |
| WireGuard | 1420 | minus 80 bytes overhead |
| IPsec ESP | ~1400 | depends on mode (tunnel/transport, AES-GCM) |
| VXLAN | 1450 | minus 50 bytes (Ethernet+IP+UDP+VXLAN headers) |
| GRE | 1476 | minus 24 bytes (GRE+IP) |
| Loopback | 65536 | kernel internal, no physical link |
Check the current MTU:
ip link show eth0 | grep mtuHow a packet is compared against the MTU
When sending a packet, the kernel checks the outgoing interface. If the IP payload + IP header exceeds the MTU and DF=0 (Don't Fragment not set), the kernel splits the packet into fragments. Each fragment is an independent IP packet with the same ID; the first carries the L4 header, the rest carry only data. The receiver reassembles them.
Downsides of fragmentation:
- A single lost fragment drops the whole packet (the receiver cannot reassemble it).
- Many firewalls drop fragments by default (L4 headers are absent from non-first fragments, so policy cannot be applied).
- CPU overhead on both sender and receiver.
- Conntrack handles fragments oddly (requires the
nf_defrag_ipv4module).
This is why IPv6 forbids intermediate fragmentation: source-only fragmentation is allowed when absolutely necessary, and PMTUD is required.
TCP MSS: solving the problem from the TCP side
TCP avoids IP fragmentation. During the SYN exchange, both sides advertise the MSS (Maximum Segment Size) option:
MSS = MTU - 20 (IP header) - 20 (TCP header) = 1460 for MTU 1500Each side picks its own MSS based on its local interface. The effective MSS for the connection is min(MSS_client, MSS_server). After the handshake, TCP cuts data into segments no larger than MSS and never fragments at IP.
PMTUD: finding the minimum along the path
There may be a link with MTU < 1500 between client and server (a tunnel, PPPoE). The MSS negotiation does not help because the client knows only its own MTU. That is where Path MTU Discovery comes in:
- TCP always sets DF=1 (Don't Fragment) on its packets.
- If a router along the path receives a packet larger than the MTU of the outgoing interface, it drops the packet and sends ICMP "Fragmentation Needed and DF Set" (ICMP type 3 code 4).
- The ICMP message includes the suggested MTU.
- The sender reduces the Path MTU for that destination (stored in the route cache).
- The packet is retransmitted at the smaller size.
MTU blackhole: broken PMTUD
PMTUD requires that ICMP packets reach the sender. On many firewalls and middleboxes ICMP is filtered "for security reasons". The result:
- The client sends a 1500-byte packet through a VPN with MTU 1400.
- The router drops the packet and sends ICMP "Frag needed, MTU 1400".
- ICMP is dropped and never reaches the client.
- The client retransmits the same 1500-byte packet.
- The router drops it again... and the loop continues.
The classic symptom: curl --max-time 5 -v https://big-page.com completes the TLS handshake (small packets), sends > GET /, but the large HTTP response hangs. SSH works in interactive mode (small packets), but cat largefile over SSH stalls.
For IPv6, a PMTUD blackhole is especially painful: fragmentation is not allowed, so TCP literally cannot deliver large packets.
MSS clamping: a workaround
When you cannot trust PMTUD (typical for VPN/tunnel setups), rewrite the MSS field in SYN packets at the router sitting in front of the tunnel. The TCP client believes the MSS is smaller and stays within the limit on its own.
In nftables:
add rule inet filter forward tcp flags syn tcp option maxseg size set rt mtuIn iptables:
iptables -t mangle -A FORWARD -p tcp --tcp-flags SYN,RST SYN \
-j TCPMSS --clamp-mss-to-pmtu--clamp-mss-to-pmtu reads the MTU of the outgoing interface and rewrites the MSS in the SYN. This is the first thing to enable on a VPN server, an OpenVZ node, or any GRE/IPsec endpoint.
The alternative is an explicit size: --set-mss 1360 when you know the exact value.
Jumbo frames: MTU 9000
In data centers, jumbo frames (MTU 9000) are often enabled between servers and SAN storage:
- Lower per-packet overhead (one TCP packet instead of six), giving higher throughput.
- Less CPU load on the network stack.
- Useful for NFS, iSCSI, and database replication.
The catch: all devices in the L2 segment (switches, NICs, the kernel bridge) must support jumbo frames. One switch capped at 1500 creates a blackhole.
To enable:
ip link set eth0 mtu 9000For persistent configuration use NetworkManager, netplan, or /etc/network/interfaces.
MTU in tunnels and overlay networks
Every tunnel adds headers, so the effective MTU inside the tunnel is smaller than the underlay MTU.
Calculation for VXLAN on underlay MTU 1500:
1500
- 14 outer Ethernet
- 20 outer IP
- 8 UDP
- 8 VXLAN header
- 14 inner Ethernet
= 1436 -> rounded to 1450 (historical convention)If a pod in Kubernetes sends 1500-byte TCP packets over flannel, they become a 1550-byte underlay packet inside VXLAN and are dropped somewhere. The solutions:
- Reduce the pod MTU to 1450 (CNI plugins do this automatically).
- Enable jumbo frames on the underlay (then pod MTU can be 9000).
- Apply MSS clamping at the CNI level.
The same logic applies to GRE and IPsec: subtract the overhead.
When something goes wrong
- Small packets pass, large ones do not. Classic blackhole. Run
ping -M do -s 1472 host(DF=1, payload 1472 = 1500 - 28). Reduce-suntil it succeeds to find the PMTU. tracepath hostshows the PMTU per hop to the destination, similar to traceroute but for MTU.apt updatehangs on a specific package. MTU is the cause 99% of the time. Enabletcp_mtu_probingor pin the interface MTU.- VPN tunnel performs poorly after a migration. Someone changed the underlay MTU. Recalculate the overhead and enable MSS clamping.
- High TCP retransmits, low throughput. Check for fragmentation with
netstat -s | grep -i frag. - iptables blocks ICMP type 3 code 4. Remove that rule; it breaks PMTUD completely.
sysctl knobs
net.ipv4.tcp_mtu_probing=1: when PMTUD is broken, the kernel probes for a working MSS and caches the result.net.ipv4.ip_no_pmtu_disc=0: setting this to 1 disables PMTUD entirely (do not do this).net.ipv4.route.min_pmtu=552: the minimum PMTU; the kernel will not go below this value.net.ipv6.conf.all.mtu=1280: the minimum for IPv6 per RFC.
Commands
ip link show eth0 | grep mtu: Show the current MTU of the interface.ip link set eth0 mtu 9000: Set MTU to 9000 (jumbo frames). Takes effect immediately, reset on reboot.ping -M do -s 1472 -c 1 8.8.8.8: Send a ping with DF=1 and a 1472-byte payload. If it fails, PMTU is below 1500.tracepath -n example.com: Show PMTU per hop to the destination, similar to traceroute but for MTU.iptables -t mangle -A FORWARD -p tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu: Standard MSS clamping for a VPN or tunnel. Rewrites the MSS field in SYN packets.nft add rule inet filter forward tcp flags syn tcp option maxseg size set rt mtu: Same MSS clamping in nftables: clamp MSS to the route MTU.sysctl -w net.ipv4.tcp_mtu_probing=1: Enable MTU probing so the kernel adapts MSS when a PMTUD blackhole is detected.ss -ti | grep -i mss: Show the current MSS of active TCP connections to verify against the expected value.