Traceroute 仅输出星星,而tracert 有效

nli*_*ite 4 networking

我正在traceroute我的 virtualbox ubuntu 和 windows 子系统 ubuntu 18.0 上测试命令。它们都不起作用。他们只显示星星。tracert但是当我在同一台计算机上测试windows命令时,它运行良好。谁能帮我?谢谢。以下是 Ubuntu 跟踪路由输出

traceroute to 8.8.8.8 (8.8.8.8), 30 hops max, 60 byte packets
 1  _gateway (10.0.2.2)  0.377 ms  0.375 ms  0.363 ms
 2  * * *
 3  * * *
 4  * * *
 5  * * *
 6  * * *
 7  * * *
 8  * * *
 9  * * *
10  * * *
11  * * *
12  * * *
13  * * *
14  * * *
15  * * *
16  * * *
17  * * *

Run Code Online (Sandbox Code Playgroud)

===========

解决了。添加 -I 选项以使用 ICMP。看到traceroute在linux(在虚拟机中)中只显示***,尽管在windows中正确显示所有IP

小智 6

Linux的traceroute默认是发送UDP数据包;Windows 默认发送 ICMP 数据包。

某些路由器可能会阻止 ICMP 数据包 - 但这两种跟踪路由都可以配置为发送 ICMP/UDP/TCP 数据包。建议您为 UDP/TCP 使用指定端口 443,并且您可能需要 root 访问权限来访问 TCP 数据包。

例如sudo traceroute -T 8.8.8.8 -p 443

lft 是第四层跟踪路由,执行 TCP 跟踪路由,类似于 traceroute -T ,但尝试提供与原始此类实现(也称为“lft”)的兼容性。它给出了更好的响应:-

sudo lft 8.8.8.8

Tracing .....**********
TTL LFT trace to dns.google (8.8.8.8):80/tcp
 1  router (192.168.1.1) 0.6ms
**  [neglected] no reply packets received from TTLs 2 through 3
 4  128.hiper04.sheff.dial.plus.net.uk (195.166.143.128) 5.7ms
 5  core1-BE1.colindale.ukcore.bt.net (195.99.125.132) 5.5ms
 6  194.72.16.204 6.0ms
 7  109.159.253.195 6.1ms
**  [80/tcp no reply from target]  Try advanced options (use -VV to see packets).
Run Code Online (Sandbox Code Playgroud)