Linux Mint

How Do I Perform a Traceroute on Linux Mint 20?

Traceroute is a very useful utility that is used to track the path that a packet takes to reach a destination within a network. It can also act as a tool to report network congestion.

In today’s article, we will discuss different examples that will demonstrate the usage of Traceroute on Linux Mint 20.

Examples of Doing a Traceroute on Linux Mint 20

For doing a Traceroute in Linux Mint 20, you first need to install the Traceroute utility with the following command:

sudo apt install traceroute –y

Once this utility is installed on your Linux Mint 20 system, these messages will be displayed on the terminal:

Now when the Traceroute utility is successfully installed, you can perform the following examples by making use of this utility in Linux Mint 20.

Example #1: Simple Usage of the Traceroute Command

The Traceroute command can be used to list down the number of hops between your source to a specified destination. All you have to do is to run this command in the manner shown below:

traceroute DestinationURL

Here, you have to replace the DestinationURL with the exact URL of the web server that you want to reach. For this case, we wanted to reach google.com, as shown in the following image:

When you run this command, it will tell you the number of hops that will be accessed while reaching this destination. In our case, that number is 30, as shown in the image below:

When the specified hop count is completed, the Traceroute will also finish, as shown in the following image:

Example #2: A Slight Variation of the Above Example

The example shown above can be modified slightly in the manner shown below:

traceroute DestinationIP

Here, you have to replace the DestinationIP with the exact IP address of the webserver that you want to reach. We wanted to reach 8.8.8.8, which is the IP address of google.com, as shown in the following image:

Again, this command will tell you the number of hops that will be accessed while reaching this destination. In our case, that number is 30, as shown in the image below:

When the specified hop count is completed, the Traceroute will also finish, as shown in the following image:

Example #3: Limiting the Number of Hops to Reach a Destination

The default number of hops to reach any destination is 30. However, you can reduce this number so that the Traceroute can finish as soon as the specified number of hops is reached. You can do this with the command shown below:

traceroute –m HopCount DestinationURL

Here, you have to replace the DestinationURL with the exact URL of the web server that you want to reach and HopCount with the number of hops that you want to traverse. We wanted to reach google.com, and the number of hops is 10, as shown in the following image:

Now, you will notice that this command will show the maximum hop count as 10, as shown in the image below:

When the 10 hops are traversed, the Traceroute will finish, as shown in the following image:

Example #4: Stop Resolving the IP Addresses to Domain Names during the Traceroute

You can even stop resolving the IP addresses to domain names during the Traceroute with the command shown below:

traceroute –n DestinationURL

Here, you have to replace the DestinationURL with the exact URL of the web server that you want to reach. We wanted to reach google.com, as shown in the following image:

When you run this command, it will tell you the number of hops that will be accessed while reaching this destination. In our case, that number is 30, as shown in the image below:

When the specified hop count is completed, the Traceroute will finish, as shown in the following image:

Example #5: Setting the Timeout Limit for Traceroute

The default timeout value for which Traceroute waits to receive responses from hops is 5 seconds. You can increase or decrease this limit in the manner shown below:

traceroute –w TimeoutLimit DestinationURL

Here, you have to replace the DestinationURL with the exact URL of the web server that you want to reach and TimeoutLimit with a floating-point value of your choice. We wanted to reach google.com, and the TimeoutLimit is 3.0, as shown in the following image:

When you run this command, it will tell you the number of hops that will be accessed while reaching this destination. In our case, that number is 30, as shown in the image below:

When the specified hop count is completed, the Traceroute will finish, as shown in the following image:

Conclusion

For using Traceroute in Linux Mint 20, you can go through the examples shared with you in this article. They will help you a lot in understanding the correct usage of this utility in Linux.

About the author

Karim Buzdar

Karim Buzdar holds a degree in telecommunication engineering and holds several sysadmin certifications. As an IT engineer and technical author, he writes for various web sites. He blogs at LinuxWays.