Skip to content

Traceroute command on Linux (find files)

The traceroute command in Linux returns the addresses of the machines and other network devices through which the packets pass to reach a certain destination. This path is known as the address route.

Traceroute also has its own executable for operating on IPv6, called traceroute6.

Traceroute uses the time to live (TTL) of IP packets to force an ICMP TIME EXCEEDED protocol response of each device through which the packet passes to obtain the necessary information.

The lifespan determines the maximum number of devices a packet can traverse before being deleted. This parameter is necessary so that packets do not wander around the network forever if their recipient is not found.

This command can investigate where the connectivity with the ping command is failing, and when that happens, it can most of the time be a problem with routes, or some ICMP packet filter.

The default TTL is 30 hosts.

The most common options are:

  • -n: This option disables name resolution;
  • -w sec: This option changes the default ICMP packet return wait time value of 5 seconds;
  • -f ttl: This option changes the default value for the initial lifespan of a packet;
  • -m max: Changes the default value of the maximum number of devices that will be tested by traceroute.

Example:

$ traceroute www.kernel.org <br></br>traceroute to www.kernel.org (204.152.189.116), 30 hops max, 40 byte packets <br></br>1 10,128.0.1 6,832 ms 8,702 ms 11,401 ms <br></br>2 10.11.0.254 13,013 ms 6,261 ms 6,993 ms <br></br>& nbsp; 3 inf001010.enl-int.redeinfovias.net.br (200.150.1.10) 72.771 ms 71.875 ms 70.068 ms <br></br>(...) <br></br>13 r7-2.r8.pao1.isc.org (192.5.4.225) 236,927 ms 234,988 ms 232.748 ms <br></br>14 r8-pao1.r3.sfo2.isc.org (192.5.4.233) 225,628 ms 214,758 ms 214,469 ms <br></br>15 zeus-pub.kernel.org (204.152.189.116) 216,677 ms 219,898 ms & nbsp; 221,776 ms