Knowledgebase

Find frequently asked questions and setup guides by searching or by browsing the categories.

The Short Answer

An MTU of 1500 means an IP packet of up to 1500 bytes, headers included. The IPv4 header takes 20 bytes and the TCP header another 20, so each TCP packet carries at most 1460 bytes of data. That figure is the MSS (maximum segment size), which both sides announce in the handshake that starts a connection (see TCP vs UDP).

Fragmentation and Path MTU Discovery

Every link on a path has its own MTU, and the smallest one sets the limit for the whole path. When a packet is too large for the next link, one of two things happens:

  • Fragmentation: an IPv4 router may split the packet into pieces, which the receiver puts back together. It works but costs performance.
  • Path MTU discovery: Linux and most other systems send TCP traffic with the "don't fragment" flag set. The router drops the packet and sends back an ICMP message saying how large a packet may be, and the sender uses smaller packets from then on. IPv6 routers never fragment, so IPv6 always relies on this.

If a firewall blocks those ICMP messages, the sender never learns the limit and keeps sending packets that disappear. This is called a PMTU black hole.

Symptoms of an MTU Problem

  • Small works, large hangs: ping and SSH login work, but a large page, an upload, or git clone stalls.
  • TLS stalls: HTTPS connections hang during the handshake, when the certificate is sent.
  • Only through a tunnel: everything works until traffic goes through a VPN.

On Your Server: Check the MTU

ip link show

Each interface line includes mtu 1500 or another value. Then test the path to a remote host with "don't fragment" set:

ping -M do -s 1472 -c 3 203.0.113.10

1472 bytes of data plus 8 bytes of ICMP header plus 20 bytes of IPv4 header make 1500. If the replies come back, the path carries full-size packets. If ping reports that the message is too long, or the requests go unanswered while a ping with -s 1400 works, lower the size step by step until it passes; the largest working size plus 28 is the path MTU. For IPv6, the header takes 40 bytes and ICMPv6 another 8, so the full-size test is 1500 minus 48, which is 1452:

ping -6 -M do -s 1452 -c 3 example.com
tracepath example.com

tracepath prints pmtu where the path MTU changes along the route, and its last line, starting with Resume:, gives the path MTU it found.

Tunnels and VPNs Lower It

A tunnel wraps each packet in extra headers, so the inner packet must be smaller. The figures assume a 1500-byte outer MTU and outer IPv4 headers:

TunnelOverheadInner MTU
WireGuard60 bytes, 80 over IPv6Usually 1420
VXLAN50 bytes, 70 over IPv61450
GRE24 bytes or more1476 or less
PPPoE8 bytes1492

When no MTU is set, wg-quick subtracts 80 bytes, the IPv6 case, from the route's MTU, so a 1500-byte link gives 1420. GRE grows when a key or checksum is added.

Another fix on gateways is MSS clamping: the firewall rewrites the MSS value in TCP handshakes so both ends send segments that fit the tunnel.

Change the MTU Safely

A wrong MTU on the interface you are connected through can cut off your SSH session. Have the console in your provider's control panel open before you start, and change one server at a time. A temporary change, lost at reboot, with your interface name from ip link:

sudo ip link set dev eth0 mtu 1400

To make it permanent on Ubuntu, set mtu: 1400 under the interface in the netplan file in /etc/netplan/, then run sudo netplan try, which rolls the change back unless you confirm it:

network:
  version: 2
  ethernets:
    eth0:
      # keep the existing lines, such as dhcp4 or addresses
      mtu: 1400

On AlmaLinux and Rocky Linux, use NetworkManager: sudo nmcli connection modify "connection name" ethernet.mtu 1400, then bring the connection up again. On Debian with ifupdown, add mtu 1400 to the interface's block in /etc/network/interfaces.

Troubleshooting Order

  1. Confirm the symptom: small requests work, large ones hang.
  2. Measure the path with ping -M do and tracepath.
  3. Check that your firewall does not drop all ICMP; see Linux network commands.
  4. Lower the MTU on the tunnel interface first, not on the main interface.

Hanging connections can also be a firewall or routing issue; see SSH connection timed out.

Was this answer helpful?
Loading...