Wednesday, February 27, 2008

HowTo: Handy Linux Network Diagnostic Tool

I should have posted this handy linux command long time ago, which was also mentioned from this link, but not explicitly eloborated.

What is MTR?

Mtr combines the functionality of the traceroute and ping programs in a single network diagnostic tool.

Mtr, when issued, investigates the network connection between the current host where mtr runs on and another host by sending packets with purposely low TTLs. Mtr 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 target host. A sudden increase in packetloss or response time is often an indication of bad, maxing out or simply overloaded internet link.

This mtr linux tool comes handy when you need to troubleshoot and isolate internet link between two hosts. Mtr can accept command line parameters as input command customization.

By default, mtr runs with reverse lookup feature enabled, resolving each trace hops to its equivalent hostname rather than IP addresses. Mtr is capable of executing traceroute and ping command both via IPv4 and IPv6, which is quite ready for future IP address worldwide evolution. Packet size and packet counts can also be specified explicitly, which increases command control over packets being sent to and from hosts. Mtr continues to send packets to and from providing statistical traceroute date between hosts including average travel time, latency, traceroute percentage and packet loss, worst and best packet replies and ping echoes.

Interactive commands are also available using mtr. Display mode can be toggled between textual visual display to numerical display, which provides continuous long running convenience over hosts being isolated for possible intermittent links and routes. Fields sorting is also being supported including the order of fields for further display customization.

Mtr Installation

Mtr comes as a single rpm package, which means, it is not part of any linux package and is available from Fedora package. Mtr is installed by default Fedora base installation. To install, simply

# yum -y install mtr

Binary Usage

# mtr google.com
# mtr ilovetux.com --no-dns
# mtr --raw gmail.com
# mtr --split googlepages.com

If you have issues with your BGP routing and multi source routes, mtr can be quite handy troubleshooting from linux box level for a more detailed routing isolation and troubleshooting when advanced routing seems so fuzzy.

All in all, mtr comes very handy, not as a replacement but as an alternative and continuous network diagnostic linux tool for ping and traceroute linux binary commands.

That is all, enjoy.

Related Articles:
Linux Magic Ping Command Explicitly Explained
Sending Ping To IP Subnet Blocks
Overly Used and Handy Linux Port Scanning Tool
Sending Ping to Nokia N70
Other Alternative and Interesting Ping Related Commands

0 comments:

Sign up for PayPal and start accepting credit card payments instantly.
ILoveTux - howtos and news | About | Contact | TOS | Policy