MTU and MSS calculator

Web pages hang over VPN or DSL although ping works? Usually the MTU does not fit. Pick the tunnels on your path and get the MTU, MSS and the matching configuration.

PPPoE, DS-Lite, WireGuard, IPsecMSS for IPv4 and IPv6Clamping for iptables, nftables, Cisco

Encapsulations on the path

Did this save you time?Buy me a coffee ↗

Works together with

See all workflows →

MTU and MSS in brief

The MTU (maximum transmission unit) is the largest IP packet a path carries in one piece, 1500 bytes on Ethernet. Every tunnel adds its own headers, so the packet inside has to get smaller.

The MSS (maximum segment size) is the part TCP uses for payload: MTU minus 40 bytes for IPv4 (20 IP + 20 TCP) and minus 60 bytes for IPv6. Routers can lower the MSS during the handshake (MSS clamping) so that both sides send smaller packets from the start.

Typical symptom

Ping and small requests work, but large web pages, downloads or SSH sessions after login hang. The cause is almost always a packet that is too large for the tunnel and a firewall dropping the ICMP message “fragmentation needed” or “packet too big”. Then automatic path MTU discovery does not work. Fix: set the MTU on the tunnel correctly and enable MSS clamping.

Where do the values come from?

EncapsulationOverhead
PPPoE8 bytes (PPPoE 6 + PPP 2), hence MTU 1492
DS-Lite40-byte IPv6 header in front of every IPv4 packet
GRE over IPv420 bytes IPv4 + 4 bytes GRE
WireGuard20 or 40 bytes IP + 8 UDP + 32 WireGuard, hence the default 1420
VXLAN14 Ethernet + 8 VXLAN + 8 UDP + 20 or 40 IP
IPsec ESPDepends on the cipher; the maximum including padding is used here

For address planning there is the subnet calculator and the IPv6 planner, for packet captures the tcpdump filter.

FAQ

Which MTU do I need for DSL with PPPoE?

1492 bytes; the IPv4 MSS is then 1452. Most routers set this themselves. If a VPN runs on top, it gets smaller accordingly.

Why does WireGuard default to 1420?

Over IPv6 WireGuard needs 80 bytes of overhead. 1500 minus 80 is 1420. Over IPv4 1440 would be enough, but 1420 fits in both cases.

Which is better, lowering the MTU or MSS clamping?

Ideally both: the MTU on the tunnel interface prevents oversized packets, and clamping makes devices behind the router send smaller TCP segments right away. UDP (e.g. DNS or QUIC) only benefits from the correct MTU.

How do I find the real path MTU?

With a ping that must not be fragmented. The calculator generates the commands for Linux, Windows and macOS. Ping packet size = MTU minus 28 bytes for IPv4, minus 48 for IPv6.