结合tcpdump命令对traceroute深入分析(2)

tcpdump -i eno33554984 -vvnn host 116.24.132.1 #温馨提示:执行完这个命令后,你需要重新执行traceroute 119.146.184.98命令才能进一步观察116.24.132.1返回的包哦 19:02:26.210530 IP (tos 0xc0, ttl 254, id 52121, offset 0, flags [none], proto ICMP (1), length 56) 116.24.132.1 > 192.168.0.200: ICMP time exceeded in-transit, length 36 IP (tos 0x0, ttl 1, id 10619, offset 0, flags [none], proto UDP (17), length 60) 192.168.0.200.43604 > 119.146.184.98.33437: UDP, length 32 #################################### #返回结果解释: #这里我们选择了采集第二跳的路由器地址116.24.132.1的数据包(为什么不用第一跳呢?因为第一跳往往是自己家里的路由器地址,这个地址的包会非常多,不容易观察到实验#结果) #从返回的结果中,我们可以看到第二跳路由器确实返回ICMP time exceeded包,实际上会有3个,就不一一列举了。

5、观察目的主机返回的ICMP-目标不可达包

#在 [root@www ~/test_traceroute]#tcpdump -i eno33554984 -vvnn host 119.146.184.98 命令返回的结果中查看 18:56:27.972224 IP (tos 0x0, ttl 248, id 20689, offset 0, flags [none], proto ICMP (1), length 56) 119.146.184.98 > 192.168.0.200: ICMP 119.146.184.98 udp port 33455 unreachable, length 36 IP (tos 0x0, ttl 2, id 10605, offset 0, flags [none], proto UDP (17), length 60) 192.168.0.200.56215 > 119.146.184.98.33455: UDP, length 32 #################################### #返回结果解释: #在返回结果中最后的地方可以看到ICMP 119.146.184.98 udp port 33455 unreachable的字样。

 

最后再总结一下traceroute常见返回结果的分析:

1、大家在练习的时候,可能第一个想到的就是拿一些知名网站来测试,下面我们就拿百度的一个ip地址来测试

[root@www ~]#traceroute -m 10 14.215.177.38 traceroute to 14.215.177.38 (14.215.177.38), 10 hops max, 60 byte packets 1 192.168.0.1 (192.168.0.1) 2.395 ms 2.063 ms 1.583 ms 2 116.24.132.1 (116.24.132.1) 36.296 ms 36.939 ms 36.706 ms 3 183.56.71.225 (183.56.71.225) 6.550 ms 6.304 ms 6.396 ms 4 183.56.66.93 (183.56.66.93) 5.716 ms 5.491 ms 5.713 ms 5 183.56.64.50 (183.56.64.50) 8.059 ms 7.733 ms 7.513 ms 6 * * * 7 14.29.121.194 (14.29.121.194) 9.082 ms 14.29.121.198 (14.29.121.198) 8.977 ms 14.29.121.206 (14.29.121.206) 9.700 ms 8 * * * 9 * * * 10 * * * #################################### 返回结果解释: *号代表发出去的UDP没有收到相应的ICMP-超时包,这个主要是因为某些路由器安全原因,拒绝返回ICMP-超时包。
所以大家可以看到第六跳的记录都是*号,说明,第六跳的路由器没有返回ICMP-超时包。 同时存在如下一点疑问:
为什么traceroute没有结束,一直不断的检测呢?(我们在命令中指定检测10跳的参数),如果你有耐心,可以指定-m 128参数,会发现traceroute始终无法自动结束,每次都需要耗尽所有的检测次数。

2、那么,为什么8 9 10跳返回的也是*呢?这里合理推测一下:

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/15438.html