Linux

Traceroute command to count hop in Linux

In this tutorial, we explain traceroute command to count hop in Linux. Traceroute is a Linux command and it is also known as networking utility using which it shows you the hops count between source and destination of the network packet and also it will show you the path/servers it goes through.

Traceroute command is used in troubleshooting the data loss occurring in the network, as each hop shows the network address of the Traceroute command to count hop in Linuxserver/router it passes, and it easy to find out packet loss at which server or router has the issue.

Now, we will see how to install traceroute command in Linux and how to troubleshoot the network.

Steps to Install Traceroute command in Linux

No need to install it because traceroute command is pre-installed on many Linux distributions. If you are not getting the traceroute command then install with below command.

Command to install traceroute in CentOS/RHEL/Oracle Linux/Amazon Linux

Command to install traceroute in Ubuntu/Debian

Command to install traceroute in Fedora

For installing any of the packages you need root access, If you have sudo access then before installing traceroute command use sudo in front of installation command.

The syntax for using traceroute command in Linux

Syntax:

Traceroute command example for Linux

How to check the route for a Linux server?

To check the trace command for gmail.com, follow below command

Use this command to check tracepath for a website or an IP address.

In Output you will find the following lines:

 The first line shows the destination IP address

 Next line & all the rest lines show the hops, their IP address and also you can see the response time etc.

 You can see the “*” for some line, this show no response received for the request.

Configure the number of queries

On each hop you traceroute send 3 queries per packet and 3 round-trip time. You can change the queries per packet using the “–q” option.

Disable IP, Hostname mapping

You can disable IP address & hostname mapping by using –n option with traceroute

There are many more options you can check this with man pages for traceroute.

Configure TTL for traceroute

Default TTL value for traceroute is 1, you can change default TTL value for traceroute by using “f” Option.

Eg:

Configure the response wait time

Response wait time also can be changed using “w” Option.

Show More

Related Articles

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Close