How to use Traceroute Command in CentOS/RHEL
In processing, traceroute is a computer network diagnostic tool for showing the path and measuring transit delays of packets over an Internet Protocol (IP) network. The historical backdrop of the course is recorded as the round-trip times of the packets got from each remote node in the path. Each hop indicates the total time spent to establish the connection.
When you connect with another PC, your traffic does not go straightforwardly to the machine you are attempting to connect with. Rather it goes through different machines on the Internet known as switches. These machines fill the sole need of controlling how your activity gets to your destination. On the off chance that any one connection fails, you will not be able to connect to the intended destination.
# traceroute www.facebook.com
Output:
traceroute to www.techoism.com (67.225.171.8), 30 hops max, 60 byte packets 1 192.168.10.19 (192.168.10.19) 0.586 ms 0.538 ms 0.426 ms 2 180.211.97.49 (180.211.97.49) 1.830 ms 1.816 ms 1.934 ms 3 202.131.102.137 (202.131.102.137) 1.902 ms 1.878 ms 1.844 ms 4 202.131.101.77 (202.131.101.77) 1.651 ms 1.638 ms 1.442 ms 5 static-221.65.93.111-tataidc.co.in (111.93.65.221) 2.385 ms 2.341 ms 3.113 ms 6 121.241.90.69.static-ahmedabad.vsnl.net.in (121.241.90.69) 1.787 ms 6.892 ms 6.851 ms 7 172.29.211.217 (172.29.211.217) 13.230 ms 10.059 ms 14.865 ms 8 ix-0-100.tcore1.MLV-Mumbai.as6453.net (180.87.38.5) 11.385 ms 14.913 ms * 9 if-2-2.tcore2.MLV-Mumbai.as6453.net (180.87.38.2) 201.027 ms 205.081 ms 200.953 ms 10 if-6-2.tcore1.L78-London.as6453.net (80.231.130.5) 196.861 ms 199.408 ms 202.987 ms 11 if-4-2.thar1.NJY-Newark.as6453.net (80.231.130.34) 200.334 ms 199.057 ms if-7-2.thar1.NJY-Newark.as6453.net (66.198.70.25) 201.763 ms 12 if-1-3.thar2.NJY-Newark.as6453.net (216.6.57.2) 204.706 ms 205.571 ms 210.118 ms 13 if-14-14.tcore2.NTO-New-York.as6453.net (66.198.111.126) 204.706 ms 200.568 ms 201.493 ms 14 66.110.96.5 (66.110.96.5) 206.721 ms 206.866 ms 206.380 ms 15 66.110.96.142 (66.110.96.142) 196.109 ms 66.110.96.130 (66.110.96.130) 204.903 ms 66.110.96.150 (66.110.96.150) 206.609 ms 16 he-5-5-0-0-cr01.newyork.ny.ibone.comcast.net (68.86.83.105) 206.970 ms 209.242 ms he-5-2-0-0-cr01.newyork.ny.ibone.comcast.net (68.86.83.97) 203.801 ms 17 be-10206-cr01.350ecermak.il.ibone.comcast.net (68.86.86.226) 230.105 ms 229.209 ms 228.444 ms 18 he-0-12-0-1-pe03.350ecermak.il.ibone.comcast.net (68.86.86.22) 227.460 ms 225.733 ms 222.588 ms 19 50.242.150.126 (50.242.150.126) 218.717 ms * 223.561 ms 20 lw-dc3-core1-te8-16.rtr.liquidweb.com (209.59.157.244) 235.323 ms 233.561 ms 233.632 ms 21 lw-dc3-dist13-po5.rtr.liquidweb.com (69.167.128.73) 225.355 ms 231.942 ms 232.943 ms
Traceroute sends out three packets per TTL increment. Each column corresponds to the time is took to get one packet back (round-trip-time). This tries to account for situations such as:
A traceroute packet is routed along a different link than other attempts
180.211.97.49 (180.211.97.49) 1.830 ms 1.816 ms 1.934 ms
A traceroute packet is dropped
ix-0-100.tcore1.MLV-Mumbai.as6453.net (180.87.38.5) 11.385 ms 14.913 ms *
Disable IP address and host name mapping
At whatever point traceroute command is run, it will demonstrate some host names with their IP addresses. Traceroute comes with a facility with which the mapping of IP addresses into their host name is deactivated. We can do this using ‘-n’ switch.
# traceroute www.techoism.com -n
Output:
traceroute to www.techoism.com (67.225.171.8), 30 hops max, 60 byte packets 1 192.168.10.19 0.544 ms 0.506 ms 0.479 ms 2 180.211.97.49 1.177 ms 1.150 ms 1.210 ms 3 202.131.102.137 1.178 ms 1.481 ms 1.671 ms 4 202.131.101.77 1.050 ms 0.890 ms 1.164 ms 5 111.93.65.221 7.546 ms 4.673 ms 4.573 ms 6 121.241.90.69 1.809 ms 2.548 ms 2.114 ms 7 172.29.211.217 15.086 ms 14.508 ms 14.903 ms 8 180.87.38.5 14.802 ms 10.652 ms 16.843 ms 9 180.87.38.2 202.398 ms 202.332 ms 208.650 ms 10 80.231.130.5 206.543 ms 199.208 ms 200.054 ms 11 80.231.130.34 202.273 ms 205.187 ms 66.198.70.25 204.901 ms 12 216.6.57.2 205.138 ms 201.010 ms 207.817 ms 13 66.198.111.126 202.650 ms 197.473 ms 205.241 ms 14 66.110.96.5 203.241 ms 206.345 ms 203.455 ms 15 66.110.96.134 203.681 ms 66.110.96.138 207.483 ms 66.110.96.142 197.660 ms 16 68.86.83.101 206.906 ms 68.86.85.189 202.685 ms 68.86.84.241 204.626 ms 17 68.86.86.226 223.367 ms 232.333 ms 224.255 ms 18 68.86.86.22 227.067 ms 228.441 ms 224.831 ms 19 50.242.150.126 228.817 ms 221.873 ms * 20 * 209.59.157.244 243.321 ms * 21 69.167.128.73 227.315 ms 232.094 ms 227.492 ms
Configure Response Wait Time
At whatever point traceroute issues a test, it wait for the response from the switch for some time span called “Response Wait Time”. The ‘-w’ option set the time (in seconds) to wait for a response to a probe. Default wait time is 5.0 sec.
# traceroute www.techoism.com -w 0.1
Output:
traceroute to www.techoism.com (67.225.171.8), 30 hops max, 60 byte packets 1 192.168.10.19 (192.168.10.19) 0.544 ms 0.503 ms 0.461 ms 2 180.211.97.49 (180.211.97.49) 10.825 ms 10.801 ms 10.769 ms 3 202.131.102.137 (202.131.102.137) 1.412 ms 1.124 ms 1.476 ms 4 202.131.101.77 (202.131.101.77) 1.058 ms 1.023 ms 0.989 ms 5 static-221.65.93.111-tataidc.co.in (111.93.65.221) 2.859 ms 2.033 ms 3.032 ms 6 121.241.90.69.static-ahmedabad.vsnl.net.in (121.241.90.69) 3.055 ms 1.712 ms 1.679 ms 7 172.29.211.217 (172.29.211.217) 16.248 ms 10.212 ms 14.633 ms 8 ix-0-100.tcore1.MLV-Mumbai.as6453.net (180.87.38.5) 14.599 ms 10.175 ms 10.151 ms 9 * * * 10 * if-6-2.tcore1.L78-London.as6453.net (80.231.130.5) 199.572 ms * 11 * * * 12 * * * 13 * if-14-14.tcore2.NTO-New-York.as6453.net (66.198.111.126) 197.383 ms * 14 * * * 15 66.110.96.130 (66.110.96.130) 199.798 ms * * 16 * * * 17 * * * 18 he-0-12-0-1-pe03.350ecermak.il.ibone.comcast.net (68.86.86.22) 226.315 ms 223.533 ms 226.256 ms 19 50.242.150.126 (50.242.150.126) 220.786 ms 223.699 ms 217.170 ms 20 * * * 21 lw-dc3-dist13-po5.rtr.liquidweb.com (69.167.128.73) 232.910 ms 228.195 ms 229.594 ms
Configure Number of Queries per Hop
As already explained earlier, the traceroute utility sends 3 packets per hop to provide 3 round trip times. This default value of 3 is configurable using the option â-qâ. This option expects an integer which it sets as new value of number of probes per hop.
# traceroute www.techoism.com -q 6
Output:
traceroute to www.techoism.com (67.225.171.8), 30 hops max, 60 byte packets 1 192.168.10.19 (192.168.10.19) 0.518 ms 0.506 ms 0.482 ms 0.443 ms 0.503 ms 0.467 ms 2 180.211.97.49 (180.211.97.49) 1.254 ms 1.226 ms 1.199 ms 1.163 ms 1.087 ms 1.056 ms 3 202.131.102.137 (202.131.102.137) 1.033 ms 1.383 ms 1.977 ms 1.936 ms 1.180 ms 1.262 ms 4 202.131.101.77 (202.131.101.77) 1.129 ms 1.101 ms 1.070 ms 1.042 ms 1.204 ms 1.160 ms 5 static-221.65.93.111-tataidc.co.in (111.93.65.221) 2.491 ms 2.846 ms 4.064 ms 4.029 ms 2.760 ms 2.934 ms 6 121.241.90.69.static-ahmedabad.vsnl.net.in (121.241.90.69) 1.635 ms 1.610 ms 1.861 ms 1.815 ms 1.795 ms 1.757 ms 7 172.29.211.217 (172.29.211.217) 9.963 ms 9.938 ms 15.537 ms 15.024 ms 14.988 ms 14.967 ms 8 ix-0-100.tcore1.MLV-Mumbai.as6453.net (180.87.38.5) 10.579 ms 10.562 ms 15.356 ms 14.838 ms 10.466 ms 10.442 ms
Configure the TTL value to start with
Traceroute utility is flexible enough to accept the TTL value that the user wants to start the utility with. By default its value is 1 which means it starts off with the first router in the path but using the â-fâ option a new value of the TTL field can be set.
# traceroute www.techoism.com -f 6
Output:
traceroute to www.techoism.com (67.225.171.8), 30 hops max, 60 byte packets 6 121.241.90.69.static-ahmedabad.vsnl.net.in (121.241.90.69) 1.867 ms 1.827 ms 1.783 ms 7 172.29.211.217 (172.29.211.217) 14.691 ms 14.838 ms 14.794 ms 8 ix-0-100.tcore1.MLV-Mumbai.as6453.net (180.87.38.5) 14.848 ms 14.804 ms 45.595 ms 9 if-2-2.tcore2.MLV-Mumbai.as6453.net (180.87.38.2) 205.646 ms 203.410 ms 205.568 ms 10 if-6-2.tcore1.L78-London.as6453.net (80.231.130.5) 203.817 ms 205.112 ms 204.670 ms