mtr — Real-Time Network Path Diagnostics

Practical guide to mtr – diagnose network paths and packet loss in real time, report mode for tickets, TCP/UDP probes for firewalled networks.

mtr combines ping and traceroute into a single tool: instead of delivering one-off snapshots, it continuously refreshes statistics for every hop along the path to a destination – so you pinpoint packet loss and latency spikes exactly where they occur. Whether you are troubleshooting a flaky connection or backing up a support ticket with hard measurement data, mtr gives you a complete diagnostic picture within seconds.

Basic Usage

mtr HOST — Start an interactive, continuously updating traceroute to a host.

mtr 8.8.8.8

mtr HOSTNAME — Trace to a hostname with live updating display.

mtr google.com

mtr -n HOST — Numeric output — skip DNS resolution for faster display.

mtr -n 8.8.8.8

mtr -b HOST — Show both hostnames and IP addresses.

mtr -b 8.8.8.8

mtr -w HOST — Wide report mode. Show full hostnames without truncation.

mtr -w 8.8.8.8

Report Mode

mtr -r HOST — Report mode — send 10 probes and print a summary. Non-interactive.

mtr -r 8.8.8.8

mtr -r -c COUNT HOST — Report mode with a specific number of probes.

mtr -r -c 100 8.8.8.8

mtr -r -w HOST — Wide report with full hostnames.

mtr -r -w google.com

mtr -r -n -c 50 HOST — Numeric report with 50 cycles. Clean output for scripting.

mtr -r -n -c 50 8.8.8.8

mtr -rw -c 100 HOST > mtr_report.txt — Save a detailed report to a file.

mtr -rw -c 100 8.8.8.8 > mtr_report.txt

mtr --json HOST — Output results in JSON format.

mtr --json -c 10 8.8.8.8

mtr --xml HOST — Output results in XML format.

mtr --xml -c 10 8.8.8.8

mtr --csv HOST — Output results in CSV format.

mtr --csv -c 10 8.8.8.8

Probe Options

mtr -c COUNT HOST — Set the number of pings per hop (cycles).

mtr -c 50 8.8.8.8

mtr -i INTERVAL HOST — Set the interval between probes in seconds (default: 1).

mtr -i 0.5 8.8.8.8

mtr -s SIZE HOST — Set the packet size in bytes.

mtr -s 1000 8.8.8.8

mtr -m MAX_TTL HOST — Set the maximum number of hops (default: 30).

mtr -m 20 8.8.8.8

mtr -f FIRST_TTL HOST — Start with a specific TTL value.

mtr -f 5 8.8.8.8

mtr --timeout SECONDS HOST — Set the timeout for each probe.

mtr --timeout 3 8.8.8.8

Protocol Options

mtr --udp HOST — Use UDP probes instead of ICMP.

mtr --udp 8.8.8.8

mtr --tcp HOST — Use TCP SYN probes. Good for firewalled networks.

sudo mtr --tcp 8.8.8.8

mtr --tcp -P PORT HOST — Use TCP SYN probes on a specific port.

sudo mtr --tcp -P 443 8.8.8.8

mtr --sctp HOST — Use SCTP probes.

sudo mtr --sctp 8.8.8.8

mtr -4 HOST — Force IPv4.

mtr -4 google.com

mtr -6 HOST — Force IPv6.

mtr -6 google.com

Interface & Source

mtr -a SOURCE_IP HOST — Bind to a specific source IP address.

mtr -a 10.0.0.5 8.8.8.8

mtr -I INTERFACE HOST — Use a specific network interface.

mtr -I eth0 8.8.8.8

Interactive Keyboard Shortcuts

d — Switch display mode (default, jitter, or both).

n — Toggle DNS resolution on/off.

r — Reset all statistics.

o — Change the order of the output fields.

j — Toggle jitter display.

p — Pause/resume.

q — Quit mtr.

Reading the Output

Loss% — Percentage of packets lost at this hop. At the destination hop, >0% indicates a problem; at intermediate hops, ICMP rate-limiting may be the cause.

Snt — Number of probes sent to this hop.

Last — Round-trip time of the last probe in ms.

Avg — Average round-trip time in ms.

Best — Minimum (best) round-trip time in ms.

Wrst — Maximum (worst) round-trip time in ms.

StDev — Standard deviation of RTT. High values indicate jitter/instability.

Common Patterns

mtr -rw -c 100 -n HOST — Generate a detailed report: 100 cycles, wide output, no DNS.

mtr -rw -c 100 -n 8.8.8.8

mtr --tcp -P 443 -rw HOST — TCP report on HTTPS port — works through most firewalls.

sudo mtr --tcp -P 443 -rw google.com

mtr -s 1400 -r -c 20 HOST — Test with large packets to detect MTU issues.

mtr -s 1400 -r -c 20 8.8.8.8

mtr --json -c 50 HOST | python3 -m json.tool — Generate JSON report with pretty printing.

mtr --json -c 50 8.8.8.8 | python3 -m json.tool

Conclusion

mtr is the first tool to reach for when a connection issue is not immediately obvious. Report mode (-r) produces reproducible measurements for tickets and post-mortems; interactive mode shows in real time exactly where packets stall. Anyone still running ping and traceroute separately tends to switch permanently after their first mtr session.

Further Reading

  • traceroute – trace the network path to a host hop by hop
  • ping – measure reachability and latency to a host
  • dig – query DNS resolution and name server responses