Test Path MTU with ping -M do

Binary-search the largest unfragmented packet that survives the path — the classic fix for 'some sites load, others hang' over VPN or PPPoE.

LinuxpingnetworkmtuDiagnosticsLow risk
Run ping -M do -s 1472 example.com (1500 minus 28 bytes of headers); lower -s by 8 until replies come back to find the working MTU.

01Command

Command
$ ping -M do -s 1472 example.com

02What it does

-M do sets the Don't Fragment bit and forbids fragmentation, so packets larger than the path's real MTU are dropped instead of split. Since each IP packet carries 20 bytes of IP header plus 8 bytes of ICMP header, -s 1472 corresponds exactly to an MTU of 1500. When a connection passes small packets but stalls on big ones (TLS handshakes, page loads), a too-large MTU on the VPN or PPPoE interface is the usual culprit.

03Risk

RiskLow risk
Requirementsiputils-ping (preinstalled on almost every distro)
!Warning: Do not lower the MTU aggressively — too small a value wastes bandwidth for every packet on the connection.

04Undo

✓No undo needed — this command does not change persistent state.

05Sources

  • ping(8) — Ubuntu man page
    Ubuntu manpages · community · 2026-09-17
    Evidence: Man page text includes '-M' and the do|dont|want path-mtu options plus -s packet size, confirming the exact flags used.
  • ping(8) — Linux man page
    man7.org · community · 2026-09-17
    Evidence: Documents -M mtu options including 'do' (prohibit fragmentation, from RFC 1191) and -s packetsize; confirms '-M' and 'mtu' text on the page.

Last verified: 2026-09-19 · Category: Network

06Related solutions