MTR Command in Linux

As someone who manages Linux systems, you know that the common belief is to blame all problems on the infrastructure, which is your area of responsibility. Network engineers, who you playfully call your “enemies”, often tell you, “It’s not a network problem.” Hearing those words can be frustrating because it means the focus shifts to you, your operating systems, and your hardware. Instead of relying on the word of the network engineers, you can proactively check the network yourself.

The mtr tool allows you to do this without bothering anyone else or getting involved in a troubleshooting meeting. The mtr command is a simple but useful tool for analyzing and troubleshooting networks. This brief explanation will help you get started.

MTR Command in Linux

  • Why MTR command?
  • Benefits of MTR
  • Installation of MTR
  • Usage of MTR
    • 1. IPv4
    • 2. IPv6

Why MTR command?

You might be wondering why I’m writing about a tool called “My Traceroute” (mtr) when there are other tools like traceroute, ping, netstat, and ip that can also help with checking network connections. Well, mtr is a bit different. It is similar to the top command because it updates itself automatically and shows you live information about how the network is responding and if you are connected.

Benefits of MTR

1. Live Network Monitoring : MTR constantly refreshes and shows you real-time information about your network connection. This helps you quickly see if there are any issues or delays.

2. Traceroute Plus Ping : MTR combines the features of traceroute (showing the path packets take) and ping (checking if a host is reachable). This gives you more useful details in one tool.

3. Easy to Read Output : The MTR output is nicely formatted and color-coded, making it easy to understand the network status at a glance.

4. Safe to Use : Running MTR does not make any changes or cause damage to your system or network. It simply checks connectivity.

5. Available on Linux : MTR comes pre-installed on many Linux distributions, or can be easily installed via package managers.

Overall, MTR is a simple yet powerful tool that helps you quickly troubleshoot and monitor network issues, without needing advanced knowledge or risking system harm.

Installation of MTR

If you do not have mtr, which is found in /usr/sbin, get it the normal way with YUM or DNF. The mtr command is part of the base collection. you can use the below command to download mtr.

Command :

sudo apt -y install mtr

Output :

Usage of MTR

The mtr command is easy to use. There are many options for using mtr, but these are the most useful for my environment. Feel free to explore all of mtr’s options. You cannot damage your system or anyone else’s system with this command. The mtr command does not create security problems for you, so use it freely.

1. IPv4

My favorite way to use mtr is with the ‘IPv4 only’ option (-4). The output will only show IPv4 addresses. This option does not stop DNS lookups. In other words, if the host has a name, you will probably see the DNS name rather than just the IPv4 address. Since mtr updates in real-time, the following video shows better how it works.

Command :

mtr -4 w3wiki.net

Output :

2. IPv6

On my system it looks like the IPv6 is the normal option which I do not want. So I always choose the IPv4 instead of IPv6.

Command :

mtr w3wiki.net

Output :

Conclusion

The mtr tool is helpful for seeing if there are problems with your network connections. It shows live updates so you can easily see if things are working well or not. The mtr command is safe to use and will not cause any damage. It is a good tool for checking network issues yourself without needing to ask others for help right away. Give mtr a try next time you suspect network troubles.

MTR Command in Linux – FAQs

What does mtr stand for?

mtr stands for “My TraceRoute”. It is a tool that helps check network connections.

Why use mtr instead of just ping or traceroute?

mtr gives live, constant updates on the network status, unlike ping or traceroute which just give a one-time result.

Can mtr break or damage my computer or network?

No, mtr is a safe tool that cannot cause any damage. It only checks the network, it does not make changes.

How do I install mtr on my Linux system?

You can install mtr using the package manager for your Linux distribution, like yum or dnf.

What is the difference between IPv4 and IPv6 with mtr?

IPv4 and IPv6 are just different types of IP addresses. Using -4 with mtr shows only IPv4 addresses.


Contact Us