tracepath

Discover the network path to a destination while automatically detecting MTU limits. Traceroute without raw sockets.

Category: Networking / Diagnostics Path Discovery MTU ICMP iputils

What it does

tracepath traces the route packets take to a destination, similar to traceroute, but also discovers the path MTU (PMTU) along the way. It works without requiring raw socket privileges.

How it works (mechanical)

tracepath sends UDP probes with increasing TTL (hop limit). Routers respond with ICMP “time exceeded” messages. When a router reports “fragmentation needed,” tracepath learns the MTU for that hop.

  • Uses UDP probes (not ICMP echo)
  • Relies on ICMP error responses
  • Automatically discovers path MTU
  • No raw socket access required

10 Practical Examples

# 1) Trace path to a host
tracepath example.com
# 2) Trace to an IP address
tracepath 8.8.8.8
# 3) IPv6 trace
tracepath6 ipv6.google.com
# 4) Show numeric output only
tracepath -n example.com
# 5) Limit maximum hops
tracepath -m 20 example.com
# 6) Diagnose PMTU black holes
tracepath large-file.example.com
# 7) Compare with traceroute output
tracepath example.com
traceroute example.com
# 8) Trace a local gateway path
tracepath $(ip route show default | awk '{print $3}')
# 9) Script-friendly single-run
tracepath -n example.com | tail -n 1
# 10) Debug VPN MTU issues
tracepath vpn-endpoint.example.com

Notes & Gotchas

  • Some routers block or rate-limit ICMP responses.
  • Final hops may show “no reply” even when connectivity works.
  • MTU discovery is the key advantage over traceroute.
  • Results differ from ICMP-based traceroute.
  • Use for MTU issues, not latency benchmarking.

Historical Context

tracepath was introduced as part of iputils to provide a safer traceroute-like tool that works without raw sockets and adds automatic PMTU discovery.

Modern Equivalent / Related Tools

  • traceroute — classic hop-by-hop tracing
  • mtr — combined traceroute and ping
  • ping — reachability and latency
  • ip route — routing decisions
  • tcpdump — packet-level verification