Linux Traceroute command

traceroute command prints the route that packets take to a network host

Written under Linux commands

Summary

traceroute command prints the route that packets take to a network host, it maps the entire path. It is useful to detect if one of the nodes is down in the path when packet traveling from source to destination machine.

Purpose

traceroute command prints the route that packets take to a network host

Syntax

traceroute [ -dFInrvx ] [ -f first_ttl ] [ -g gateway ] [ -i iface ] [ -m max_ttl ] [ -p port ] [ -q nqueries ] [ -s src_addr ] [ -t tos ] [ -w waittime ] [ -z pausemsecs ] host [ packetlen ]

Options

-n Print hop addresses numerically rather than symbolically and numerically (saves a nameserver address-to-name lookup for each gateway found on the path).

Usage and examples

Example usage of traceroute command

$ traceroute linux.tips
traceroute to linux.tips (104.18.53.231), 30 hops max, 60 byte packets
 1  DD-WRT (192.168.3.1)  0.976 ms  1.610 ms  1.585 ms
 2  96.120.72.41 (96.120.72.41)  10.552 ms  11.520 ms  11.844 ms
 3  68.86.222.121 (68.86.222.121)  14.100 ms  14.060 ms  14.433 ms
 4  96.108.8.178 (96.108.8.178)  15.262 ms  15.206 ms  15.121 ms
 5  be-86-ar03.plainfield.nj.panjde.comcast.net (96.108.8.161)  15.986 ms  19.069 ms  19.030 ms
 6  be-33659-cr02.newyork.ny.ibone.comcast.net (68.86.90.21)  21.894 ms  16.437 ms  16.029 ms
 7  be-10203-cr01.newark.nj.ibone.comcast.net (68.86.85.185)  16.300 ms  14.081 ms  16.537 ms
 8  be-10249-pe03.newark.nj.ibone.comcast.net (68.86.85.90)  18.236 ms  13.677 ms  16.766 ms
 9  66.208.229.78 (66.208.229.78)  16.308 ms  16.149 ms  16.337 ms
10  104.18.53.231 (104.18.53.231)  16.039 ms  16.180 ms  15.283 ms

 

How to install traceroute command on Linux OS?

The traceroute program can be using the following commands

sudo apt-get install traceroute

 

How to traceroute when using ipv6?

Use the -6 option when trying to traceroute of a host on an ipv6 protocol:

traceroute -6 ipv6.google.com