How do I run a MTR on an Ubuntu server?
To run a MTR from an Ubuntu device, you first need to install the MTR package provided by Linux. If you have not installed MTR on your Ubuntu device before, run the following install commands:
|
Command 1
|
|
|
Command Description |
Issue the following command to update the list of available packages. |
|
Command |
apt-get update -y
|
|
Image of Command being Run |
|
|
Image of a Successful Result of Command |
|
|
Command 2
|
|
|
Command Description |
Issue the following command to start the install of MTR |
|
Command |
apt install mtr
|
|
Image of Command being Run |
|
|
Image of a Successful Result of Command |
As you can see in my example above, the MTR package has been replaced by the updated version MTR-Tiny package.
|
Once you have installed the MTR package, you can now issue a command to begin the MTR.
When issuing the below command, you will need to enter the IP address of the destination device. What the destination device is depends on what problem you are experiencing and trying to diagnose. If you are experiencing packet loss or if there is a routing issue between two devices, you will need enter the IP address of the other device. In my example, I am running a MTR from one of my servers to another, as I believe that there may be packet loss between the two servers.
|
Command 3
|
|
|
Command Description |
Issue the following command to start the MTR, running a trace the destination IP address. |
|
Command |
mtr [insert destination IP address]
|
|
Image of Command being Run |
|
|
Image of a Successful Result of Command |
|
The MTR will now start and it should send roughly one packet per second. You can see how many packets have been sent from the host you are running the MTR on in the top row, in-line with the host’s IP, under the sent column.
Once the MTR has sent 1000 packets, you can use the results to identify where the issue lies. We require at least 1000 packets to be sent to make sure that the results are accurate.
If you are checking for packet loss, you can use the Loss% column to identify the percentage of packets lost within this hop, and you can use the Host column in line with the Loss% column to identify where the packet loss began. If you are checking for a routing issue, you can use the Host column to identify the path the route has taken.
Once the MTR has sent 1000 packets, you should copy the entire MTR table and paste it into a text document. If you do identify an issue, you will need these results later. To copy the table from a putty window, you simply need highlight the whole table. You can see an example of a copied table below.
| Packets | Pings | ||||||||
| Host | Loss% | Snt | Last | Avg | Best | Wrst | St | Dev | |
| 1 | □8.□29.□50.□□ | 0.00% | 1100 | 0.5 | 0.6 | 0.5 | 0.8 | 0 | |
| 2 | e1-46.lea302.1ue.dc5.as20860.net | 0.00% | 1100 | 0.6 | 0.6 | 0.5 | 0.7 | 0 | |
| e1-45.lea302.1ue.dc5.as20860.net | |||||||||
| 3 | e3-21.bor2.dc5.as20860.net | 0.00% | 1100 | 0.7 | 0.7 | 0.7 | 0.9 | 0 | |
| 4 | po2-30.net1.north.dc5.as20860.net | 0.00% | 1100 | 0.4 | 0.3 | 0.3 | 0.4 | 0 | |
| 5 | □7.□17.□11.□□ | 0.00% | 1100 | 1.2 | 1.4 | 0.9 | 2.4 | 0.3 | |
| 6 | □3.□42.□28.□□ | 0.00% | 1100 | 0.3 | 0.4 | 0.3 | 0.5 | 0 |
Once you have finished running the MTR on this device and copied the table, press Q to stop the MTR.
You should now run the MTR on the destination device, to the device you just ran the MTR on above, then copy the table (reverse direction). If you do discover any issues that lie within our network, please supply both MTRs in a support ticket and our team will investigate this issue.
If you have any more questions about MTRs, please look through our FAQ section, or raise a support ticket and we will be happy to help.