traceroute Command Examples in Linux

The traceroute command is used to report the network path between the source and destination computers, including any routers the connection uses. The process of a packet traveling from one router to the next is called a hop. The traceroute command therefore outputs each hop along the path. This is particularly effective when troubleshooting Internet connectivity or connections within very large routed environments. If the traceroute fails, being able to identify where along the path it failed is useful for troubleshooting.

Syntax

The syntax of the traceroute command is:

# traceroute [options] {destination}

Many routing issues are the result of misconfigured routing tables. These issues can usually be fixed by updating the routing tables. However, you must first identify what is causing the issue. Commands like traceroute and tracepath can reveal routing issues like routing loops, in which traffic is continuously routed back and forth between multiple nodes and never reaches its destination. For example, node A uses node B as a path to node C; but node B uses node A as a path to C. If traffic is bound for node C, nodes A and B will endlessly send the traffic between them because they both think each other is the path to C.

traceroute Command Examples

1. Traceroute to a host:

# traceroute host

2. Disable IP address and host name mapping:

# traceroute -n host

3. Specify wait time for response:

# traceroute -w 0.5 host

4. Specify number of queries per hop:

# traceroute -q 5 host

5. Specify size in bytes of probing packet:

# traceroute host 42

Conclusion

Traceroute is designed using the ICMP protocol as a component. Traceroute allows an administrator to map the path a packet would take between the source to the destination. Traceroute exists both in the Windows and Linux systems.

Related Post