2-Minute Linux Tip: How to use the mtr command

Network World | Apr 25, 2018

In today’s Linux tip, we’re going to look at the mtr command and see what it can tell us about network connections. Mtr stands for “my traceroute” and displays the route that a connection to a particular system takes by providing a continuously updating display of timing data.

Similar
Hi, this is Sandra Henry-Stocker, author of the “Unix as a Second Language” blog on NetworkWorld.
In today’s 2-minute Linux tip, we’re going to look at the mtr command and see what it can tell us about network connections. Mtr stands for “my traceroute” and displays the route that a connection to a particular system takes by providing a continuously updating display of timing data.
As you will soon see, mtr shows all the routers that a connection crosses to reach the specified destination. To use the command, you only need to type “mtr” followed by the name or IP address of the system you’re trying to reach.
$ mtr world.std.com
Notice how the values are being continuously updated.
Packets Pings
Host Loss% Snt Last Avg Best Wrst StDev
1. gateway 20.0% 5 1.7 1.8 1.4 2.1 0.0
2. 10.224.64.1 0.0% 5 25.3 27.9 25.1 37.3 5.2
3. 10.20.0.33 0.0% 4 26.4 25.9 25.7 26.4 0.0
4. 10.20.0.221 0.0% 4 25.0 26.5 25.0 28.1 1.3
5. 10.20.0.226 0.0% 4 26.3 26.0 25.6 26.3 0.0
6. 204.111.0.132 0.0% 4 28.8 36.2 28.8 49.7 9.3
7. ae-3.a01.asbnva02.us.bb.gin.ntt. 0.0% 4 44.1 34.7 28.7 44.1 6.6
8. ae-4.fastly.asbnva02.us.bb.gin.n 0.0% 4 30.4 29.3 28.5 30.4 0.6
9. ???
10. 151.101.66.165 0.0% 4 29.7 28.7 28.2 29.7 0.6
Type q or ^c to stop the display.
Notice that each “hop” in this output is numbered and that the first group are local (starting with 10) IP addresses.
You can see that we’re getting some packet loss on the first hop. The numbers on the right tell us how many milliseconds it takes to cross that particular hop and we see the command displays the last time value along with the average, the best and the worst.
The higher the standard deviation the greater the difference between the best and worst round trip times.
Understand that you can lose packets and still have very reliable connections. If you have problems with connections, on the other hand, mtr can help you pinpoint where the problems are coming from. Look for very high round trip times or evidence that your connections aren’t getting through.
That’s your 2-minute Linux tip for today. If you liked this video, please hit the like and share buttons. For more Linux tips, be sure to follow us on Facebook, YouTube and NetworkWorld.com.
Popular