tracert通过向目标IP地址发送不同 TTL值的Internet 控制消息协议ICMP回应数据包。
举例:追踪百度
C:\Users\Administrator>tracert www.baidu.com
通过最多 30 个跃点跟踪
到 www.baidu.com [110.242.68.3] 的路由:
1 1 ms 1 ms 1 ms moshujia.cn [192.168.124.1]
2 5 ms 3 ms 5 ms [10.186.128.1]
3 13 ms * * [60.221.11.109]
4 10 ms * 19 ms [60.221.7.161]
5 24 ms 23 ms 24 ms 219.158.114.53
6 24 ms 24 ms 24 ms 110.242.66.174
7 28 ms 28 ms 29 ms 221.194.45.130
pathping命令,可以根据时延和丢包率判断网络质量
举例:追踪百度
C:\Users\Administrator>pathping www.baidu.com
通过最多 30 个跃点跟踪
到 www.a.shifen.com [110.242.68.4] 的路由:
0 DESKTOP-6SI8NI9 [192.168.124.12]
1 moshujia.cn [192.168.124.1]
2 DESKTOP-6SI8NI9 [10.186.128.1]
3 105.11.221.60.adsl-pool.sx.cn [60.221.11.105]
4 33.11.221.60.adsl-pool.sx.cn [60.221.11.33]
5 * * *
正在计算统计信息,已耗时 100 秒...
指向此处的源 此节点/链接
跃点 RTT 已丢失/已发送 = Pct 已丢失/已发送 = Pct 地址
0 DESKTOP-6SI8NI9 [192.168.124.12]
0/ 100 = 0% |
1 1ms 0/ 100 = 0% 0/ 100 = 0% moshujia.cn [192.168.124.1]
0/ 100 = 0% |
2 4ms 0/ 100 = 0% 0/ 100 = 0% DESKTOP-6SI8NI9 [10.186.128.1]
0/ 100 = 0% |
3 3ms 0/ 100 = 0% 0/ 100 = 0% 105.11.221.60.adsl-pool.sx.cn [60.221.11.105]
0/ 100 = 0% |
4 10ms 0/ 100 = 0% 0/ 100 = 0% 33.11.221.60.adsl-pool.sx.cn [60.221.11.33]
跟踪完成。
traceroute指令让追踪网络数据包的路由途径,预设数据包大小是40Bytes,用户可另行设置
?举例:追踪百度
$ traceroute www.baidu.com
traceroute to www.baidu.com (184.61.20.7), 30 hops max, 60 byte packets
1 192.168.1.1 0.353 ms *
2 10.0.11.254 (10.0.11.254) 0.912 ms 1.433 ms 1.627 ms
3 124.25.26.49 (124.205.26.47) 8.052 ms 8.856 ms 9.71 ms
4 10.255.19.185 (10.255.149.185) 3.08 ms 3.338 ms 2.789 ms
5 10.255.36.45 (10.25.36.45) 2.948 ms 2.138 ms 2.66 ms
6 218.241.253.77 (218.241.253.77) 1.712 ms 1.673 ms 1.402 ms
7 14.197.77.21 (14.197.177.21) 4.934 ms 14.187.177.81 (14.197.177.81) 120.167 ms 14.17.178.49 (14.197.178.49) 1.574 ms
8 14.197.249.126 (14.197.249.126) 2.159 ms 14.197.14.182 (14.197.149.182) 2.117 ms 14.197.29.134 (14.197.249.134) 2.342 ms
9 182.61.52.218 (182.61.252.218) 2.938 ms 182.61.22.212 (182.61.252.212) 2.557 ms 182.61.252.220 (182.61.252.220) 2.749 ms
tracepath指令可以追踪数据到达目标主机的路由信息,同时还能够发现MTU值。?
举例:?追踪百度
[root@master ~]# tracepath www.baidu.com
1?: [LOCALHOST] pmtu 1500
1: moshujia.cn 2.366ms
1: moshujia.cn 1.269ms
2: moshujia.cn 2.490ms pmtu 1492
2: localhost 7.314ms
3: no reply
4: 33.11.221.60.adsl-pool.sx.cn 13.195ms
5: 219.158.105.13 24.324ms
6: 110.242.66.182 26.180ms
7: 221.194.45.134 25.726ms
-n 不看主机名字,光显示IP地址
[root@master ~]# tracepath -n www.baidu.com
1?: [LOCALHOST] pmtu 1500
1: 192.168.124.1 1.573ms
1: 192.168.124.1 6.131ms
2: 192.168.124.1 3.298ms pmtu 1492
2: 10.186.128.1 5.122ms
3: 60.221.11.109 23.500ms
4: 60.221.11.41 13.875ms
5: 219.158.14.249 24.413ms
6: 110.242.66.166 24.602ms
7: 221.194.45.134 27.055ms