Posted: . At: 8:01 AM. This was 10 years ago. Post ID: 7578
Page permalink. WordPress uses cookies, or tiny pieces of information stored on your computer, to verify who you are. There are cookies for logged in users and for commenters.
These cookies expire two weeks after they are set.

The mtr command for Linux. Another way to trace network hops using the command line.

The mtr command for Linux is another good way to trace network hops. Use it like this: mtr --report [HOST]

homer@deusexmachina ~ $ mtr --report yahoo.com
Start: Mon Jul 28 07:42:16 2014
HOST: deusexmachina               Loss%   Snt   Last   Avg  Best  Wrst StDev
  1.|-- 192.168.100.1              0.0%    10    0.3   0.3   0.3   0.4   0.0
  2.|-- 185.3.148.122.network.m2c  0.0%    10   29.0  29.3  28.9  30.0   0.0
  3.|-- be2-v547-bsr02-sydnmtc.sy  0.0%    10   29.9  30.4  29.7  31.0   0.0
  4.|-- ???                       100.0    10    0.0   0.0   0.0   0.0   0.0
  5.|-- bundle-ether21.ken39.sydn  0.0%    10   32.6  36.4  32.6  41.4   3.4
  6.|-- bundle-ether6.ken-core4.s  0.0%    10   31.9  32.6  30.7  34.1   0.9
  7.|-- bundle-ether19.ken-core10  0.0%    10   31.4  32.5  31.4  33.6   0.5
  8.|-- Bundle-ether18.pad-gw2.sy  0.0%    10   32.9  32.2  30.3  34.1   0.9
  9.|-- bundle-ether1.sydp-core01  0.0%    10   33.8  32.7  30.2  34.6   1.3
 10.|-- i-0-1-0-3.paix-core01.bx.  0.0%    10  169.8 170.3 168.0 174.3   1.7
 11.|-- i-0-5-0-2.paix02.bi.telst  0.0%    10  167.6 168.2 165.7 172.2   1.5
 12.|-- ???                       100.0    10    0.0   0.0   0.0   0.0   0.0
 13.|-- ae-6.pat2.swp.yahoo.com    0.0%    10  186.2 186.8 185.0 192.4   2.0
 14.|-- ae-5.pat2.gqb.yahoo.com    0.0%    10  201.0 198.3 189.3 201.9   5.0
 15.|-- ae-0.msr2.gq1.yahoo.com    0.0%    10  190.7 193.9 189.6 219.2   8.9
 16.|-- UNKNOWN-67-195-1-X.yahoo.  0.0%    10  191.5 196.9 190.2 200.8   4.6
 17.|-- et-17-1.fab6-1-gdc.gq1.ya 10.0%    10  190.7 194.4 190.7 201.3   4.5
 18.|-- po-14.bas1-7-prd.gq1.yaho 10.0%    10  203.2 201.7 199.1 204.0   1.6
 19.|-- ir1.fp.vip.gq1.yahoo.com  10.0%    10  191.3 190.9 189.8 192.5   0.6

Use the –csv parameter like this to output in CSV format.

mtr --report yahoo.com --csv

If you want the mtr command to output using a curses interface with bold text highlighting; use this command.

mtr --report yahoo.com --curses

The –tcp parameter to mtr will use TCP SYN packets instead of ICMP echo. This is a fast way of performing a traceroute of network hops.

homer@deusexmachina ~ $ mtr --report yahoo.com --tcp
Start: Mon Jul 28 07:55:37 2014
HOST: deusexmachina               Loss%   Snt   Last   Avg  Best  Wrst StDev
  1.|-- 192.168.100.1              0.0%    10    0.3   0.3   0.3   0.4   0.0
  2.|-- 185.3.148.122.network.m2c  0.0%    10   29.8  30.1  29.5  31.3   0.3
  3.|-- be2-v547-bsr02-sydnmtc.sy  0.0%    10   31.7  32.0  31.4  33.3   0.3
  4.|-- ???                       100.0    10    0.0   0.0   0.0   0.0   0.0
  5.|-- bundle-ether21.ken39.sydn  0.0%    10   36.0  37.0  32.6  43.1   3.0
  6.|-- bundle-ether6.ken-core4.s  0.0%    10   33.0  33.9  32.3  36.1   1.1
  7.|-- bundle-ether19.ken-core10  0.0%    10   34.2  33.3  31.9  34.4   0.7
  8.|-- Bundle-ether18.pad-gw2.sy  0.0%    10   34.4  34.0  31.4  37.0   1.4
  9.|-- bundle-ether1.sydp-core01  0.0%    10   32.2  34.6  32.1  36.4   1.4
 10.|-- i-0-3-0-1.paix-core01.bx.  0.0%    10  176.6 170.9 168.2 176.6   2.3
 11.|-- i-0-0-0-2.paix02.bi.telst  0.0%    10  170.4 169.6 168.3 174.9   1.9
 12.|-- ???                       100.0    10    0.0   0.0   0.0   0.0   0.0
 13.|-- ae-7.pat2.dnx.yahoo.com    0.0%    10  194.2 198.9 194.2 228.1  10.4
 14.|-- ae-6.pat1.nez.yahoo.com    0.0%    10  203.3 206.9 202.8 223.4   6.3
 15.|-- ae-0.msr2.ne1.yahoo.com    0.0%    10  215.3 209.4 201.9 225.8   8.6
 16.|-- ae-0.clr1-a-gdc.ne1.yahoo 10.0%    10  214.0 213.6 202.8 220.8   4.6
 17.|-- UNKNOWN-98-138-97-X.yahoo 10.0%    10  213.5 209.0 203.8 221.4   6.3
 18.|-- po-10.bas1-7-prd.ne1.yaho 10.0%    10  215.1 212.3 204.4 221.1   5.9
 19.|-- ir1.fp.vip.ne1.yahoo.com  10.0%    10  266.0 252.0 212.0 301.6  31.8

And finally, the –report-wide parameter will show a wider display of the output.

homer@deusexmachina ~ $ mtr --report yahoo.com --tcp --report-wide
Start: Mon Jul 28 07:57:34 2014
HOST: deusexmachina                                Loss%   Snt   Last   Avg  Best  Wrst StDev
  1.|-- 192.168.100.1                                 0.0%    10    0.3   0.3   0.3   0.4   0.0
  2.|-- 185.3.148.122.network.m2core.net.au           0.0%    10   30.2  30.0  29.4  30.8   0.0
  3.|-- be2-v547-bsr02-sydnmtc.syd.nsw.m2core.net.au  0.0%    10   32.2  31.8  31.3  32.5   0.0
  4.|-- 66.3.148.122.network.m2core.net.au           70.0%    10   32.4 364.2  32.4 1027. 574.4
  5.|-- bundle-ether21.ken39.sydney.telstra.net       0.0%    10   39.6  37.8  32.6  43.0   3.4
  6.|-- bundle-ether6.ken-core4.sydney.telstra.net    0.0%    10   35.4  34.4  31.9  37.4   1.8
  7.|-- bundle-ether19.ken-core10.sydney.telstra.net  0.0%    10   35.3  33.4  31.4  35.3   0.8
  8.|-- Bundle-ether18.pad-gw2.sydney.telstra.net     0.0%    10   33.1  33.8  32.1  37.0   1.3
  9.|-- bundle-ether1.sydp-core01.sydney.reach.com    0.0%    10   34.7  33.3  31.5  34.7   0.9
 10.|-- i-0-3-0-2.paix-core01.bx.telstraglobal.net    0.0%    10  168.3 171.7 168.3 176.8   2.6
 11.|-- i-0-0-0-7.paix02.bi.telstraglobal.net         0.0%    10  170.1 169.5 168.2 171.1   0.7
 12.|-- ???                                          100.0    10    0.0   0.0   0.0   0.0   0.0
 13.|-- ae-7.pat2.dnx.yahoo.com                       0.0%    10  227.5 202.9 194.1 227.5  11.0
 14.|-- ae-5.pat2.nez.yahoo.com                       0.0%    10  210.4 205.1 202.9 210.4   2.4
 15.|-- ae-0.msr1.ne1.yahoo.com                       0.0%    10  203.7 209.7 203.0 216.5   6.3
 16.|-- UNKNOWN-98-138-97-X.yahoo.com                10.0%    10  214.3 213.5 204.6 217.4   4.1
 17.|-- UNKNOWN-98-138-97-X.yahoo.com                10.0%    10  216.2 211.1 203.0 216.5   5.8
 18.|-- po-14.bas2-7-prd.ne1.yahoo.com               10.0%    10  214.8 209.2 203.0 217.5   6.0
 19.|-- ir1.fp.vip.ne1.yahoo.com                     10.0%    10  265.8 234.2 212.3 301.5  34.2

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.