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

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/02/echo/image1-24.png" data-lazy- height="27" src="data:image/svg xml,” width=”490″>

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

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/02/echo/image3-20.png" data-lazy- height="381" src="data:image/svg xml,” width=”645″>

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:

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/02/echo/image2-23.png" data-lazy- height="26" src="data:image/svg xml,” width=”417″>

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:

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/02/echo/image5-17.png" data-lazy- height="39" src="data:image/svg xml,” width=”583″>

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

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/02/echo/image4-19.png" data-lazy- height="412" src="data:image/svg xml,” width=”645″>

Example #2: A Slight Variation of the Above Example

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

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:

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/02/echo/image7-14.png" data-lazy- height="25" src="data:image/svg xml,” width=”395″>

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:

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/02/echo/image6-14.png" data-lazy- height="39" src="data:image/svg xml,” width=”497″>

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

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/02/echo/image9-12.png" data-lazy- height="411" src="data:image/svg xml,” width=”641″>

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:

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/02/echo/image8-13.png" data-lazy- height="23" src="data:image/svg xml,” width=”465″>

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

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/02/echo/image12-7.png" data-lazy- height="40" src="data:image/svg xml,” width=”578″>

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

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/02/echo/image10-11.png" data-lazy- height="226" src="data:image/svg xml,” width=”578″>

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:

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/02/echo/image11-9.png" data-lazy- height="25" src="data:image/svg xml,” width=”443″>

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:

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/02/echo/image13-6.png" data-lazy- height="39" src="data:image/svg xml,” width=”576″>

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

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/02/echo/image14-6.png" data-lazy- height="410" src="data:image/svg xml,” width=”642″>

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:

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/02/echo/image15-4.png" data-lazy- height="28" src="data:image/svg xml,” width=”473″>

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:

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/02/echo/image16-4.png" data-lazy- height="39" src="data:image/svg xml,” width=”576″>

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

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2021/02/echo/image17-4.png" data-lazy- height="410" src="data:image/svg xml,” width=”646″>

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

<img alt="Karim Buzdar" data-lazy-src="https://kirelos.com/wp-content/uploads/2021/02/echo/karim-150×150.png60367603b5140.jpg" height="112" src="data:image/svg xml,” width=”112″>

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.