Ping & Traceroute Command Builder
Generate correct ping, traceroute and MTU-discovery commands for Linux, Windows, macOS, Cisco IOS, Junos and RouterOS - with the flags that differ between them.
Result
ping -c 5 -s 1472 -M do 8.8.8.8
traceroute -n 8.8.8.8
mtr -rwbzc 5 8.8.8.8ping -n 5 -l 1472 -f 8.8.8.8
tracert -d 8.8.8.8
Test-NetConnection -ComputerName 8.8.8.8 -TraceRouteping -c 5 -s 1472 -D 8.8.8.8
traceroute -n 8.8.8.8ping 8.8.8.8 repeat 5 size 1500 df-bit
traceroute 8.8.8.8 numericping 8.8.8.8 count 5 size 1472 do-not-fragment
traceroute 8.8.8.8 no-resolve/ping address=8.8.8.8 count=5 size=1500 do-not-fragment=yes
/tool traceroute address=8.8.8.8About Ping & Traceroute Command Builder
Every platform spells ping differently, and the differences are exactly the ones that matter during an MTU investigation: whether the size argument means payload or whole packet, and how you set the do-not-fragment bit. This builds all six variants from one set of inputs.
Path MTU discovery by hand
Set DF and send progressively larger packets until they stop returning. On Linux, ping -M do -s 1472 tests a 1500-byte path (1472 payload + 8 ICMP + 20 IP). If that fails but 1464 succeeds, your path MTU is 1492 - the classic PPPoE signature. A path that silently drops oversized packets instead of returning "fragmentation needed" is an ICMP black hole, and it breaks TCP in ways that look like an application bug.
Reading a traceroute honestly
Middle hops that show stars or high latency are usually deprioritising ICMP generation, not dropping traffic. Only the final hop and the trend across hops carry real signal. Asymmetric return paths mean a traceroute shows you one direction only - a fact worth stating before anyone blames a transit provider.
Common use cases
- Finding the real path MTU on a tunnelled or PPPoE link.
- Sourcing a ping from a specific interface or loopback to test a routing policy.
- Handing a correct command to a customer or field engineer on an unfamiliar platform.
Edge cases and gotchas
- IPv6 headers are 40 bytes, not 20 - subtract 20 more from the payload when testing an IPv6 path.
- Some networks rate-limit or block ICMP entirely; no response does not always mean no reachability.