Linux Command: mtr
Combine ping and traceroute in a single network diagnostic tool
mtr (My Traceroute) combines the functionality of traceroute and ping into a single real-time diagnostic tool. It continuously probes each hop in the network path, showing packet loss and latency statistics. mtr is far superior to traceroute for diagnosing network issues because it provides ongoing statistics rather than a single snapshot. It shows packet loss percentage, average/best/worst latency, and standard deviation for each hop. mtr is the tool network engineers reach for first when diagnosing connectivity issues. It quickly reveals where packet loss or latency spikes occur in the network path.
Syntax
mtr [OPTION]... HOSTKey Options
-rโ Report mode (text output, then exit)-cโ Number of pings per hop-nโ No DNS resolution-wโ Wide report (show IPs and hostnames)-Tโ Use TCP instead of ICMP-4/-6โ Force IPv4 or IPv6
Examples
Interactive trace
mtr example.comReport mode
mtr -r -c 100 example.comOutput: HOST Loss% Snt Avg Best Wrst
1. gateway 0.0% 100 1.2 0.8 3.4
2. isp-router 0.5% 100 5.6 4.2 12.1
Wide report
mtr -rw -c 50 8.8.8.8Pro Tips
- Loss at one hop but not the next is usually harmless (router deprioritizes ICMP). Loss that persists to the destination is real.
- mtr -rw -c 100 host gives a comprehensive report. Paste this when reporting network issues to your ISP or hosting provider.
- ICMP mode (default) often needs root. TCP mode (-T) always needs root. Use sudo mtr.
Learn more: Full mtr reference โ
Related Resources