Use My traceroute(MTR) for network diagnostic

My traceroute(MTR) combines the functionality of traceroute and ping and allows to monitor the hops on a network path constantly.

MTR tries to connect to a given remote host by increasing the TTL(time to live) in every packet send. To report the hops on the network path it relies on ICMP and the Time Exceeded message(type: 11, code 0) returned by the hops. It also reports the latency and the packet loss for every hop constantly.

The tool is not installed by default on most linux systems but it is available from the packet repository at least of all major linux distributions at the time of writing.

Installation

Ubuntu and Debian

$ sudo apt-get install mtr

CentOS

$ sudo yum install mtr

arch linux

$ sudo pacman -S mtr

Usage

In the listing below you can find an example on how to start the tool.

$ mtr dinotools.de

After starting the tool it displays the current stats in the terminal window.

                            My traceroute  [v0.93]
example (192.168.98.76)                                2020-01-18T19:27:39+0100
Keys:  Help   Display mode   Restart statistics   Order of fields   quit
                                       Packets               Pings
 Host                                Loss%   Snt   Last   Avg  Best  Wrst StDev
 1. _gateway                          0.0%     5    1.3   1.4   1.1   2.0   0.4
 2. 192.168.123.45                    0.0%     5    1.5   1.8   1.5   2.3   0.3
 3. 123-45-67-89-isp.superkabel.de    0.0%     5   10.2  12.8   9.8  19.0   3.7
 4. ip5886ea47.static.kabel-deutschl  0.0%     5   13.7  13.0  11.8  14.3   1.1
 5. 145.254.3.70                      0.0%     5   17.3  15.7  14.0  17.3   1.4
 6. 145.254.2.179                     0.0%     5   58.2  33.7  24.5  58.2  13.8
 7. 145.254.2.179                     0.0%     5   33.4  25.8  21.3  33.4   4.6
 8. decix2-gw.hetzner.de              0.0%     5   20.5  27.3  19.5  53.9  14.9
 9. core22.fsn1.hetzner.com           0.0%     5   28.0  27.8  25.7  32.5   2.8
10. ex9k2.dc6.fsn1.hetzner.com        0.0%     5   30.2  26.9  24.6  30.2   2.4
11. dinotools.de                      0.0%     5   24.9  27.1  24.9  31.6   2.6

By default mtr sends out ICMP messages, but it is also possible to use TCP or UDP. There are also additional features like resolving the AS number an IP address belongs to.

Conclusion

As an network engineer mtr should be part of your tool collection to analyse network issues. In the past we were even able to identify bad hops on the network path in the internet and got help by the CIX providers instantly. If the target host does not respond to ICMP but has an open TCP or UDP port mtr can be used in TCP or UDP mode.

Links

Verwandte Artikel