mtr google.com

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 (0.0.0.0)                                                           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. hagrid.fryfrog.com                                    0.0%    12    0.6   0.6   0.6   0.8   0.1
 2. ???
 3. 68.85.191.1                                           0.0%    12   29.3  20.4   7.5  36.6  10.3
 4. te-8-2-ur01.santaclara.ca.sfba.comcast.net            0.0%    12   12.7  15.8  10.1  26.5   5.8
 5. be-30-ar01.sfsutro.ca.sfba.comcast.net                0.0%    12   14.2  22.8  13.3  35.1   7.1
 6. pos-1-6-0-0-cr01.sanjose.ca.ibone.comcast.net         0.0%    12   14.1  18.7  11.0  36.2   7.1
 7. xe-10-2-0.edge1.SanJose1.Level3.net                   0.0%    12   16.2  20.4  10.2  48.7  13.4
 8. ge-1-1-0-79.bbr2.SanJose1.Level3.net                  0.0%    12   29.2  22.3  13.2  29.2   5.2
 9. as-1-0.bbr1.Atlanta1.Level3.net                       0.0%    12   74.8  83.4  74.8  99.9   7.2
    ae-0-0.bbr2.Atlanta1.Level3.net
10. ae-21-52.car1.Atlanta1.Level3.net                     0.0%    12   79.7 108.8  75.6 271.8  55.3
    ae-11-51.car1.Atlanta1.Level3.net
11. GOOGLE-INC.car1.Atlanta1.Level3.net                   0.0%    12   88.5  81.0  76.2  92.5   6.2
12. 209.85.254.243                                        0.0%    11   92.0 105.4  82.4 169.4  24.8
    209.85.254.241
13. 209.85.253.141                                        0.0%    11  129.7  92.7  80.6 129.7  15.1
    209.85.253.133
    209.85.253.145
    209.85.253.137
14. yx-in-f100.google.com                                 0.0%    11  110.6  86.3  78.7 110.6   9.1

434
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 · 482 weeks ago
Droool.. this is awesome, im hypnotized!
foucault · 482 weeks ago
Great command! Thanx for sharing.
betsubetsu · 482 weeks ago
Great one.. Thanks..
ergut · 481 weeks and 6 days ago
To run in terminal do: mtr -t Great tool! Thanks!
nongeekboy · 479 weeks and 5 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 · 431 weeks and 1 day ago
The homebrew system is a great way to get this tool on OSX, btw -> http://github.com/mxcl/homebrew
4fthawaiian · 430 weeks and 1 day ago
great one, thanks for sharing!
KoRoVaMiLK · 425 weeks and 4 days 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 · 403 weeks and 5 days ago
great, thanks!
maneeshshetty · 378 weeks and 1 day 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 · 376 weeks 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 · 280 weeks and 4 days ago
To install this using Macports, do sudo port install mtr
cma · 279 weeks and 3 days 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?

commandlinefu.com 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.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

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: