ToB企服应用市场:ToB评测及商务社交产业平台
标题:
Linux shell编程学习笔记67: tracepath下令 追踪数据包的路由信息
[打印本页]
作者:
种地
时间:
2024-10-14 00:25
标题:
Linux shell编程学习笔记67: tracepath下令 追踪数据包的路由信息
0 媒介
网络信息是电脑网络信息安全检查中的一块紧张内容,Linux和基于Linux的操作体系,提供了很多的网络下令,本日我们研究tracepath下令。
Tracepath 在大多数 Linux 发行版中都是可用的。如果在你的体系中没有预装,请根据你的发行版利用下面的下令举行安装。
Windows中没有tracepath下令。
1 tracepath下令 的功能、格式和选项说明
1.1 tracepath下令 的功能
tracepath下令的功能是追踪数据包的路由信息,它可以追踪并表现数据包到达目标主机所经过的路由信息,以及对应的MTU值。
tracepath 与 traceroute 雷同,用于确定数据包访问目标地所经历的路由路径。
Tracepath 特别适用于没有 root 权限的用户,因为它不须要特权即可运行。
1.2 tracepath下令 的格式
跟ping下令一样,我们可以利用 tracepath 或 tracepath -?下令获取ping下令的格式信息。 tracepath不支持 --?选项。
登录后复制
[purpleendurer @ bash ~] tracepath
Usage: tracepath [-n] [-b] [-l <len>] [-p port] <destination>
[purpleendurer @ bash ~] tracepath -?
Usage: tracepath [-n] [-b] [-l <len>] [-p port] <destination>
[purpleendurer @ bash ~] tracepath --?
tracepath: invalid option -- '-'
Usage: tracepath [-n] [-b] [-l <len>] [-p port] <destination>
[purpleendurer @ bash ~]
复制代码
1.
2.
3.
4.
5.
6.
7.
8.
tracepath [-n] [-b] [-l <最大路径长度>] [-p 端标语] <目标域名或IP所在>
1.3 tracepath下令选项说明
与ping下令相比,tracepath的下令不算多。
不外不同版本的Linux提供的tracepath下令选项不尽相同。
选项
说明
-n
输出数字格式的所在
-b
输出回程路径
-l 最大路径长度
设置最大路径长度
-m 最大TTL值
设置查询的最大TTL值
-p 端标语
设置UDP端标语
-V
表现版本信息
2 tracepath下令实例
2.1 tracepath g.cn
登录后复制
[purpleendurer @ bash ~] tracepath g.cn
1?: [LOCALHOST] pmtu 1500
1: 26.10.178.42 2.037ms
1: 26.10.178.42 2.238ms
2: 11.73.57.238 1.986ms
3: 11.73.37.65 1.852ms
4: 11.73.49.81 3.004ms
5: 10.222.215.161 2.377ms
6: 10.54.171.129 3.831ms
7: 10.102.154.246 4.610ms asymm 6
8: no reply
9: no reply
10: 61.149.190.38 5.299ms asymm 9
11: no reply
12: no reply
13: no reply
14: no reply
15: no reply
16: no reply
17: no reply
18: no reply
19: no reply
20: no reply
21: no reply
22: no reply
23: no reply
24: no reply
25: no reply
26: no reply
27: no reply
28: no reply
29: no reply
30: no reply
Too many hops: pmtu 1500
Resume: pmtu 1500
[purpleendurer @ bash ~]
复制代码
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
34.
35.
36.
下令返复书息中的PMTU (Path Maximum Transmission Unit,数据通信网络中发现路径最大传输单元)是优化网络性能的关键技能之一。PMTU决定了数据在网络中传输的最大数据包大小 。
2.2 tracepath -b g.cn :输出回程路径
登录后复制
[purpleendurer @ bash ~] tracepath -b g.cn
1?: [LOCALHOST] pmtu 1500
1: 26.10.178.42 (26.10.178.42) 2.308ms
2: 11.73.56.206 (11.73.56.206) 1.952ms
3: 11.73.31.193 (11.73.31.193) 2.034ms
4: 11.73.48.73 (11.73.48.73) 2.678ms
5: 10.222.214.217 (10.222.214.217) 15.309ms
6: 10.54.171.141 (10.54.171.141) 3.707ms
7: 10.102.154.222 (10.102.154.222) 4.003ms
8: no reply
9: no reply
10: 114.243.132.194 (114.243.132.194) 5.394ms asymm 9
11: no reply
12: no reply
13: no reply
14: no reply
15: no reply
16: no reply
17: no reply
18: no reply
19: no reply
20: no reply
21: no reply
22: no reply
23: no reply
24: no reply
25: no reply
26: no reply
27: no reply
28: no reply
29: no reply
30: no reply
Too many hops: pmtu 1500
Resume: pmtu 1500
[purpleendurer @ bash ~]
复制代码
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
34.
35.
2.3 tracepath -l 512 g.cn:设置最大路径长度为512
登录后复制
[purpleendurer @ bash ~] tracepath -l 512 g.cn
1: 26.10.178.42 2.625ms
2: 11.73.56.206 1.956ms
3: 11.73.37.161 1.943ms
4: 11.73.50.209 3.318ms
5: 10.222.214.241 3.257ms
6: 11.94.197.101 3.779ms asymm 7
7: 116.251.112.161 4.019ms asymm 6
8: no reply
9: no reply
10: 114.243.132.194 5.299ms asymm 9
11: no reply
12: no reply
13: no reply
14: no reply
15: no reply
16: no reply
17: no reply
18: no reply
19: no reply
20: no reply
21: no reply
22: no reply
23: no reply
24: no reply
25: no reply
26: no reply
27: no reply
28: no reply
29: no reply
30: no reply
Too many hops: pmtu 512
Resume: pmtu 512
[purpleendurer @ bash ~]
复制代码
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
34.
2.4 tracepath -p 80 g.cn:利用UDP 80端口
登录后复制
[purpleendurer @ bash ~] tracepath -p 80 g.cn
1?: [LOCALHOST] pmtu 1500
1: 26.10.178.42 2.337ms
1: 26.10.178.42 2.357ms
2: 11.73.56.78 1.909ms
3: 11.73.36.129 1.877ms
4: 11.73.43.185 2.385ms
5: 10.222.214.193 2.221ms
6: 10.54.171.221 3.892ms
7: 116.251.112.157 3.971ms asymm 6
8: no reply
9: 125.33.184.177 4.492ms asymm 8
10: 114.243.132.194 4.819ms asymm 9
11: no reply
12: no reply
13: no reply
14: no reply
15: no reply
16: no reply
17: no reply
18: no reply
19: no reply
20: no reply
21: no reply
22: no reply
23: no reply
24: no reply
25: no reply
26: no reply
27: no reply
28: no reply
29: no reply
30: no reply
Too many hops: pmtu 1500
Resume: pmtu 1500
[purpleendurer @ bash ~]
复制代码
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
34.
35.
36.
2.5 tracepath -n g.cn :输出数字格式的所在
登录后复制
[purpleendurer @ bash ~] tracepath -n g.cn
1?: [LOCALHOST] pmtu 1500
1: 26.10.178.42 2.073ms
1: 26.10.178.42 2.068ms
2: 11.73.57.174 1.826ms
3: 11.73.32.57 2.603ms
4: 11.73.52.81 2.285ms
5: 10.222.215.113 2.359ms
6: 10.54.171.141 3.860ms
7: 10.102.154.234 3.791ms
8: no reply
9: no reply
10: 114.243.132.194 4.967ms asymm 9
11: no reply
12: no reply
13: no reply
14: no reply
15: no reply
16: no reply
17: no reply
18: no reply
19: no reply
20: no reply
21: no reply
22: no reply
23: no reply
24: no reply
25: no reply
26: no reply
27: no reply
28: no reply
29: no reply
30: no reply
Too many hops: pmtu 1500
Resume: pmtu 1500
[purpleendurer @ bash ~]
复制代码
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
34.
35.
36.
免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!更多信息从访问主页:qidao123.com:ToB企服之家,中国第一个企服评测及商务社交产业平台。
欢迎光临 ToB企服应用市场:ToB评测及商务社交产业平台 (https://dis.qidao123.com/)
Powered by Discuz! X3.4