查看到网站的网络路径
网页打不开或很慢?用 traceroute 看数据包在哪一跳出问题。
运行 `traceroute -w 2 example.com` 即可逐跳列出延迟。
01命令
命令
$ traceroute -w 2 example.com02作用说明
traceroute 会显示数据包经过的每一台路由器和对应的耗时。如果前几跳正常、后面某跳开始超时,说明问题通常不在你家的路由器,而在运营商或对方机房,报修时把这段输出给客服非常有用。-w 2 表示每跳最多等 2 秒,避免在拦截探测包的路由器上干等。
03风险
!注意: 不少路由器会忽略 traceroute 探测包,某几跳显示 *** 不一定代表断网。
04撤销
✓无需撤销——该命令不会改变持久状态。
05来源
- traceroute — print the route packets take to a host (macOS man page)依据: Documents traceroute tracing the IP route to a host and printing each hop with timings.
最后验证: 2026-09-18 · 分类: 网络