用 `traceroute` 追踪到目标主机的路由
经典的「一用就忘」命令:traceroute 会列出你与目标之间的每一台路由器,以及探测包到每一跳的往返时间。
运行 `traceroute example.com`(或 `traceroute -I example.com` 使用 ICMP 探测),即可逐跳列出路径上的路由器及其响应时间。
01命令
命令
$ traceroute example.com02作用说明
traceroute 的原理是发送 TTL 递增的数据包,每个路由器在 TTL 耗尽时返回「超时」报文从而暴露自己。哪一跳延迟突然增大,就能判断慢在你本地、运营商还是更上游。某跳显示 `* * *` 表示没有应答——通常只是该路由器不回应探测包,并不一定代表故障。
03风险
!注意: 很多网络会过滤默认的 UDP 探测;改用 `-I`(ICMP)或 `-T`(TCP,需 root)通常能得到完整结果。
04撤销
✓无需撤销——该命令不会改变持久状态。
05来源
- traceroute(8) — print the route packets trace to network host依据: Documents traceroute's default UDP probing, TTL increments, and output format with hop latency
最后验证: 2026-09-17 · 分类: 网络