tracepath命令 – 追踪报文的路由信息《openstack网络》

编程入门 行业动态 更新时间:2024-10-06 04:10:03

tracepath命令 – 追踪<a href=https://www.elefans.com/category/jswz/34/1768911.html style=报文的路由信息《openstack网络》"/>

tracepath命令 – 追踪报文的路由信息《openstack网络》

tracepath命令用来追踪并显示报文到达目的主机所经过的路由信息,能够发现路由中的MTU值。tracepath使用套接字API来实现其所有功能,不需要root权限。

It traces path to destination discovering MTU along this path. It uses UDP port port or some random port. It is similar to traceroute, only does not not require superuser privileges. Option -c causes tracepath to use the return address instead of the reply type (connection refused) to determine when to stop.

tracepath6 is good replacement for traceroute6 and classic example of application of Linux error queues. The situation with tracepath is worse, because commercial IP routers do not return enough information in icmp error messages. Probably, it will change, when they will be updated. For now it uses Van Jacobson’s trick, sweeping a range of UDP ports to maintain trace history.

使用参数

Usage: tracepath [-n] [-b] [-l <len>] [-p port] <destination>-n	只显示ip地址
-b	同时显示ip地址和主机名
-l	设置初始化的数据包长度,默认为65535
-m	设置最大TTL值,默认为30
-p	设置要使用的初始目标端口

实践

追踪到达域名的主机路由信息(同时显示ip地址与主机名)

[root@781c38071bbd ~]# tracepath -b www.baidu1?: [LOCALHOST]                                         pmtu 15001:  gateway (172.17.0.1)                                  0.140ms1:  gateway (172.17.0.1)                                  0.091ms2:  10.6.9.254 (10.6.9.254)                               2.002ms3:  10.6.111.1 (10.6.111.1)                               0.364ms4:  123.235.52.17 (123.235.52.17)                        60.508ms5:  27.223.59.193 (27.223.59.193)                         2.986ms6:  119.167.86.237 (119.167.86.237)                       2.821ms asymm  57:  219.158.114.62 (219.158.114.62)                      15.927ms8:  219.158.17.210 (219.158.17.210)                      13.737ms asymm  79:  221.194.45.130 (221.194.45.130)                      21.492ms

设置追踪报文路由的最大TTL值

[root@781c38071bbd ~]# tracepath -m 5 -b  www.baidu1?: [LOCALHOST]                                         pmtu 15001:  gateway (172.17.0.1)                                  0.122ms1:  gateway (172.17.0.1)                                  0.109ms2:  10.6.9.254 (10.6.9.254)                               1.976ms3:  10.6.111.1 (10.6.111.1)                               0.299ms4:  123.235.52.17 (123.235.52.17)                        27.441ms5:  27.219.237.45 (27.219.237.45)                         2.979msToo many hops: pmtu 1500Resume: pmtu 1500

更多推荐

tracepath命令 – 追踪报文的路由信息《openstack网络》

本文发布于:2024-03-09 06:22:47,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1724129.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:报文   路由   命令   网络   信息

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!