mtr
(My Traceroute) is a network diagnostic tool that displays latency and packet loss on a network connection in real-time. While the ping
command only shows whether the destination is reachable, mtr
analyzes intermediate nodes and shows in detail where the problem is along the path.
Basic Usage:
mtr 1.1.1.1
or
mtr 8.8.8.8
These commands trace the network connection path to Cloudflare (1.1.1.1) and Google DNS (8.8.8.8) IP addresses, respectively.
What Does It Show?
-
Each line represents a network gateway (router).
-
Loss%
: Packet loss rate -
Snt
: Number of packets sent -
Last
,Avg
,Best
,Wrst
: Latency times (in milliseconds)
Live Example:
mtr 1.1.1.1
Host Loss% Snt Last Avg Best Wrst StDev
1. gateway.local 0.0% 10 1.2 1.5 1.1 2.5 0.4
2. isp1.core.net 0.0% 10 5.2 5.5 4.8 6.3 0.6
3. 1.1.1.1 0.0% 10 11.2 10.9 10.1 11.6 0.5
Ping Test for Specific IP:
ping 103.21.244.0 -n 50
This command sends 50 ICMP packets to the 103.21.244.0 address. However, since IPs ending with .0
are usually network addresses, no response may be received. Instead, an active host IP such as 103.21.244.1
should be used.
Alternative Parameters for the mtr Command:
-
mtr -rw 1.1.1.1
: Gives output in short and report format -
mtr --report --report-cycles 10 8.8.8.8
: Pings 10 rounds and then gives a summary report
Installation (CentOS/AlmaLinux):
yum install mtr -y
Ubuntu/Debian:
apt install mtr -y
Summary:
-
ping
: Access test to a single destination and average latency -
mtr
: Live tracking of the path passing through multiple points and detection of the problematic point -
If addresses such as 103.21.244.0 are not suitable for testing, host IPs such as .1 or .10 should be preferred.
For detecting network connection problems, mtr
is a much more comprehensive tool for system administrators than ping
.