Cyberithub

7 Simple Steps to Install MTR(My Traceroute) on Linux(RHEL/CentOS 7/8)

In this tutorial, I will take you through 7 Simple Steps to Install MTR(My traceroute) on Linux(RHEL/CentOS 7/8). MTR is an open source command line Network diagnostic tool which has the functionality of both traceroute and ping command. It implements the functionality of both traceroute and ping command and has many added features over these commands.

While using MTR tool for tracing the path of destination server you can see lot of other useful statistics for each of the hops as compared to traditional traceroute command that you use. You can see important information like packet loss percentage, av. response time etc. Hence it is a very important tool to troubleshoot and debug any network issues between source and destination.

7 Simple Steps to Install MTR(My Traceroute) on Linux(RHEL/CentOS 7/8)

Steps to Install MTR(My Traceroute) on Linux(RHEL/CentOS 7/8)

Also Read: How to Install and Use i3 Window Manager on Ubuntu 20.04

Step 1: Prerequisites

a) You require a running RHEL/CentOS 7/8 Server.

b) You should have yum installed in your Server. You can check Top 22 YUM command examples in RedHat/CentOS 7 to know more about yum command.

c) You should have root or sudo access to run Privileged commands on your Server. Please Check How to Add User to Sudoers to know more about providing sudo access to the User.

Step 2: Update Your Server

Before going through the steps to install MTR on RHEL/CentOS 7/8, it is always recommended to update your Server first by using yum update -y command as mentioned below.

[root@localhost ~]# yum update -y
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: centos.excellmedia.net
* epel: download.nus.edu.sg
* extras: centos.excellmedia.net
* updates: centos.excellmedia.net
---> Package elfutils-libs.x86_64 0:0.176-5.el7 will be an update
---> Package epel-release.noarch 0:7-12 will be updated
---> Package epel-release.noarch 0:7-13 will be an update
---> Package expat.x86_64 0:2.1.0-11.el7 will be updated
---> Package expat.x86_64 0:2.1.0-12.el7 will be an update
---> Package file.x86_64 0:5.11-36.el7 will be updated
---> Package file.x86_64 0:5.11-37.el7 will be an update
---> Package file-libs.x86_64 0:5.11-36.el7 will be updated
---> Package file-libs.x86_64 0:5.11-37.el7 will be an update
---> Package firewalld.noarch 0:0.6.3-8.el7_8.1 will be updated
---> Package firewalld.noarch 0:0.6.3-11.el7 will be an update
---> Package firewalld-filesystem.noarch 0:0.6.3-8.el7_8.1 will be updated
---> Package firewalld-filesystem.noarch 0:0.6.3-11.el7 will be an update
---> Package freeradius.x86_64 0:3.0.13-10.el7_6 will be updated
---> Package freeradius.x86_64 0:3.0.13-15.el7 will be an update
---> Package freeradius-mysql.x86_64 0:3.0.13-10.el7_6 will be updated
---> Package freeradius-mysql.x86_64 0:3.0.13-15.el7 will be an update
---> Package freeradius-utils.x86_64 0:3.0.13-10.el7_6 will be updated
---> Package freeradius-utils.x86_64 0:3.0.13-15.el7 will be an update

Step 3: Install MTR(My traceroute) on Linux

To install MTR on RHEL/CentOS 7/8 Based Servers you need to use yum install mtr -y command as shown below. This will download MTR package from enabled YUM repository and install it with the required dependencies.

[root@localhost ~]# yum install mtr -y
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
epel/x86_64/metalink | 7.3 kB 00:00:00
* base: centos.excellmedia.net
* epel: download.nus.edu.sg
* extras: centos.excellmedia.net
* updates: centos.excellmedia.net
base | 3.6 kB 00:00:00
epel | 4.7 kB 00:00:00
extras | 2.9 kB 00:00:00
mysql-connectors-community | 2.6 kB 00:00:00
mysql-tools-community | 2.6 kB 00:00:00
mysql56-community | 2.6 kB 00:00:00
updates | 2.9 kB 00:00:00
(1/2): epel/x86_64/updateinfo | 1.0 MB 00:00:01
(2/2): epel/x86_64/primary_db | 6.9 MB 00:00:19
Resolving Dependencies
--> Running transaction check
---> Package mtr.x86_64 2:0.85-7.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

========================================================================================================================================================================
Package Arch Version Repository Size
========================================================================================================================================================================
Installing:
mtr x86_64 2:0.85-7.el7 base 71 k

Transaction Summary
========================================================================================================================================================================
Install 1 Package

Total download size: 71 k
Installed size: 128 k
Downloading packages:
mtr-0.85-7.el7.x86_64.rpm | 71 kB 00:00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : 2:mtr-0.85-7.el7.x86_64 1/1
Verifying : 2:mtr-0.85-7.el7.x86_64 1/1

Installed:
mtr.x86_64 2:0.85-7.el7

Complete!

Step 4: Verify MTR Installation

To verify the MTR tool installation you can query the installation package details from RPM DB using rpm -qa | grep -i mtr command as shown below. If the package is installed it will show the details else it won’t show anything on the output. You can check more about rpm command on 25 Practical and Useful rpm command examples in Linux{cheatsheet}

[root@localhost ~]# rpm -qa | grep -i mtr
mtr-0.85-7.el7.x86_64

Step 5: Check MTR Version

Installed MTR version can be checked by using mtr -v command. As you can see from below output, current version is 0.85.

[root@localhost ~]# mtr -v
mtr 0.85

-v : Print the installed version of mtr. Check more on MTR Man Page.

Step 6: Using MTR in Linux

It’s usage is pretty much same as traceroute in Linux. You can simply run mtr <domain_name> or mtr <ip_address> command to trace the path of a URL based on domain name or IP Address. For example here we are tracing the path of google.com using mtr google.com command as shown below.

[root@localhost ~]# mtr google.com
                                   My traceroute [v0.85]
localhost (0.0.0.0)                                                     Wed Nov 18 11:39:43 2020
Keys: Help Display mode Restart statistics Order of fields quit
                                                                        Packets           Pings
Host                                                                    Loss% Snt Last Avg Best Wrst StDev
1. 192.168.0.1                                                          0.0% 6 5.3 4.3 2.2 6.9 1.5
2. 23.10.0.1                                                            0.0% 6 3.9 5.6 3.3 9.0 2.2
3. vegas.corp.us                                                        75.0% 5 8.8 8.8 8.8 8.8 0.0
4. 24.14.145.5.static-arizona.corp.net.us                               0.0% 5 14.6 10.8 4.2 20.6 6.6
5. 87.11.167.58                                                         0.0% 5 13.0 13.0 10.2 16.3 2.1
6. 24.140.100.6.static-texas.corp.us                                    0.0% 5 20.4 13.4 9.6 20.4 4.2
7. 15.11.71.65.STDILL-texas.corp.net.us                                 0.0% 5 37.2 34.3 30.3 38.3 3.4
8. 121.240.1.50                                                         0.0% 5 15.2 14.3 11.3 15.4 1.5
9. 74.125.242.129                                                       0.0% 5 13.7 14.6 10.8 19.8 3.2
10. 216.239.42.235                                                      0.0% 5 22.8 15.4 9.4 22.8 5.1
11. maa05s01-in-f14.1e100.net                                           0.0% 5 11.5 10.3 9.1 12.1 1.2

Step 7: Remove MTR from Linux

Once you are done with the MTR utility, you can also uninstall this tool by using yum remove mtr -y command as shown below.

[root@localhost ~]# yum remove mtr -y
Loaded plugins: fastestmirror
Resolving Dependencies
--> Running transaction check
---> Package mtr.x86_64 2:0.85-7.el7 will be erased
--> Finished Dependency Resolution

Dependencies Resolved

========================================================================================================================================================================
Package Arch Version Repository Size
========================================================================================================================================================================
Removing:
mtr x86_64 2:0.85-7.el7 @base 128 k

Transaction Summary
========================================================================================================================================================================
Remove 1 Package

Installed size: 128 k
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Erasing : 2:mtr-0.85-7.el7.x86_64 1/1
Verifying : 2:mtr-0.85-7.el7.x86_64 1/1

Removed:
mtr.x86_64 2:0.85-7.el7

Complete!

 

 

 

 

 

 

 

Popular Recommendations:-

Troubleshooting guide to Fix all Postfix Mail Server issues in Linux

How to Suppress all the output of a Linux Bash Shell Script

How to Convert/Change time to epoch time using date utility on Linux/Unix Server

How to Install jq(JSON Processor) on RHEL/CentOS 7/8 

How to Defragment an XFS Filesystem in Linux(5 Simple and Effective Steps)

How to Install Arpwatch tool on RHEL/CentOS 7/8(Simple and Effective Steps)

10 Easy Steps to Install psacct or acct User Activity monitoring tool on RHEL/CentOS 7/8

Leave a Comment