mtr, better than traceroute and ping combined

mtr combines the functionality of the traceroute and ping programs in a single network diagnostic tool. As mtr starts, it investigates the network connection between the host mtr runs on and HOSTNAME. by sending packets with purposly low TTLs. It continues to send packets with low TTL, noting the response time of the intervening routers. This allows mtr to print the response percentage and response times of the internet route to HOSTNAME. A sudden increase in packetloss or response time is often an indication of a bad (or simply over‐loaded) link.
Sample Output
My traceroute  [v0.73]
apollo (                                                           Fri Feb 20 23:52:43 2009
Keys:  Help   Display mode   Restart statistics   Order of fields   quit
                                                           Packets               Pings
 Host                                                    Loss%   Snt   Last   Avg  Best  Wrst StDev
 1.                                    0.0%    12    0.6   0.6   0.6   0.8   0.1
 2. ???
 3.                                           0.0%    12   29.3  20.4   7.5  36.6  10.3
 4.            0.0%    12   12.7  15.8  10.1  26.5   5.8
 5.                0.0%    12   14.2  22.8  13.3  35.1   7.1
 6.         0.0%    12   14.1  18.7  11.0  36.2   7.1
 7.                   0.0%    12   16.2  20.4  10.2  48.7  13.4
 8.                  0.0%    12   29.2  22.3  13.2  29.2   5.2
 9.                       0.0%    12   74.8  83.4  74.8  99.9   7.2
10.                     0.0%    12   79.7 108.8  75.6 271.8  55.3
11.                   0.0%    12   88.5  81.0  76.2  92.5   6.2
12.                                        0.0%    11   92.0 105.4  82.4 169.4  24.8
13.                                        0.0%    11  129.7  92.7  80.6 129.7  15.1
14.                                 0.0%    11  110.6  86.3  78.7 110.6   9.1

By: fryfrog
2009-02-21 07:53:32

1 Alternatives + Submit Alt

What Others Think

Hi, Your command line works great. i get some interesting information from the traceroute and it keeps the information updated. im running ubuntu EEE (easy Peasy) 8.10 on my netbook. Greets Snipercup
snipercup · 660 weeks and 4 days ago
Droool.. this is awesome, im hypnotized!
foucault · 660 weeks and 4 days ago
Great command! Thanx for sharing.
betsubetsu · 660 weeks and 4 days ago
Great one.. Thanks..
ergut · 660 weeks and 3 days ago
To run in terminal do: mtr -t Great tool! Thanks!
nongeekboy · 658 weeks and 2 days ago
I like to use mtr -r -c 100 You don't get to watch but it'll print the statistics. You win some, you lose some.
brie · 609 weeks and 5 days ago
The homebrew system is a great way to get this tool on OSX, btw ->
4fthawaiian · 608 weeks and 5 days ago
great one, thanks for sharing!
KoRoVaMiLK · 604 weeks and 1 day ago
Love this! Also love brie's example however I find 100 take's quite a while to report. Thanks to the both of you this is super handy!
danstinebaugh · 582 weeks and 2 days ago
great, thanks!
maneeshshetty · 556 weeks and 5 days ago
Hi this a good command but this have a problem, is detected by the firewall , with many connections to dns provider probably your machine will be block by firewall,
aarntesla · 554 weeks and 4 days ago
tl;dr: mtr provides false reports. It's worth mentioning a few things. First, ICMP packets must be processed by the control plane of a router or switch. "Normal" packets, however, are switched by hardware ASICs (in provider cores and some business devices). This means that you could see "latency" and/or "packet loss" where there is none. In addition to being processed by the control plane, ICMP is often either rate-limited, blocked, policed, or otherwise handled differently than "normal" traffic. What I'm trying to point out is that it's important to not just understand WHAT your tool does, but HOW it does it and how the results may be affected. This is true for any tool, but in my work I've seen many rely on results of "ping plotter" and "mtr" and similar tools to determine trouble and it is simply not always accurate. Service provider devices (particularly devices manufactured by Cisco) tend to have very weak processors. Poor network design (with regards to control plane tasks such as BGP scanning and SPF calculations) can also lead to false reports of packet loss.
pkttlk · 459 weeks and 1 day ago
To install this using Macports, do sudo port install mtr
cma · 458 weeks ago

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What's this? is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands

Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.


Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: