Since we published the Linux Networking Commands article in October 2017, I have had several comments that I should have included the "My Trace Route" command. Ofcourse, readers were correct, but I felt that this tool deserved its own article.
Some of you, depending on what version of Linux you use may not have even heard of this tool, or you may not have the tool in your distribution (for example Ubuntu - yes, Parrot - no, at least as of the writing of this article).
So what is 'mtr' or My Trace Route? According to the man pages it combines ping and traceroute. It looks for low TTL values and then continually pings those addresses showing a real time screen update displaying round trip times and packet loss information.
In a recent class, one of my students was complaining about speed of their connection to the CellStream Web Site from their student server. So I decided to use mtr on their Student Server (which is running Linux to test it. First there are a number of command line options:
You can clearly see that it has IPv4 and IPv6 options with the -4 and -6 command line switches.
So what does it look like and how does it work?
Simple - just open a terminal and type 'mtr www.cellstream.com'. That's it:
This will keep updating. To quit hit 'q' or CTRL-C.
So what are we looking at?
First, we have a trace route to the www.cellstream.com web site (at Digital Ocean in NYC) from the location of the student server (at Rackspace). We see it took 12 hops. Not bad.
Then the program essentially pings each of the hops and after each round, updates the chart.
After 26 rounds, I took the screen shot. There was no packet loss (awesome). Then in columns we see the milliseconds to ping and respond from each of the hops. While it is clear that there is some delay in the telia network we are still well under 50 milliseconds.
So the network looks OK to me, it must be server delay. Now the next step would have been to get a packet capture of all this, but at that point the student was happy.
Since there were 21 students (plus me) probably all hitting up the cellstream server at the same step in the labs, that made sense.
Beware of certain problems you can encounter. For example - I tried to use mtr in a location that was IPv6 and IPv4 on a virtual Linux machine, and here is what I got:
You can see that I am going one hop - inside my virtual machine host and that is it! For success in the VM environment make sure you have network settings that allow your VM to have an IP outside your host machine.
I hope this has helped you learn yet another great Linux tool for networking!