Linux - MTR (Real-Time Traceroute + Ping)
What is MTR?
MTR (My Traceroute) is a network diagnostic tool that combines:
-
Ping (latency & packet loss)
-
Traceroute (path/hops)
into a single, real-time, continuously updating tool.
It shows:
-
All routers between you and a destination
-
Latency at each hop
-
Packet loss percentage
-
Real-time network fluctuation
How to install MTR
Debian/Ubuntu
sudo apt install mtr
CentOS/RHEL
sudo yum install mtr
Mac (Homebrew)
brew install mtr
How to use MTR
Basic usage
mtr google.com
This opens a live, updating interface showing hops, latency, and packet loss.
Run MTR in report mode (useful for logs or support teams)
mtr -r -c 10 google.com
-
-r→ report mode -
-c 10→ send 10 pings to each hop
Use ICMP instead of UDP (more accurate on many networks)
sudo mtr -I google.com
Use TCP mode (useful when ICMP/UDP is blocked)
sudo mtr -T google.com
How to read an MTR output
Example:
Host Loss% Snt Last Avg Best Wrst StDev
1 192.168.1.1 0% 10 1 1 1 5 0.4
2 10.0.0.1 0% 10 5 6 4 10 1.2
3 72.14.205.1 5% 10 15 16 12 30 4.1
4 google.com 0% 10 23 24 20 40 3.3
Key indicators
| Column | Meaning |
|---|---|
| Loss% | Packet loss at each hop |
| Avg | Average latency to that hop |
| Wrst | Worst latency (spikes) |
| StDev | Stability of ping times |
How to analyze
-
Packet loss at first hop → your router is the issue
-
Packet loss in the middle hops → ISP routing issue
-
High latency only at last hop → destination server is slow
-
Loss at an intermediate hop but not the last hop
→ ignore it (router deprioritizes ICMP but passes traffic normally)
Why MTR is better than ping or traceroute alone
| Feature | ping | traceroute | mtr |
|---|---|---|---|
| Latency | ✔ | ✔ | ✔ (live) |
| Packet loss | ✔ | Limited | ✔ (per hop) |
| Shows path | ✖ | ✔ | ✔ |
| Real-time updates | ✖ | ✖ | ✔ |
| Best for diagnosing | Basic issues | Routing issues | Everything |
Network engineers prefer MTR because it gives a full picture in seconds.