我可以使用wireshark 捕获127.0.0.0 和0.0.0.0 网络吗?
网络工程
思科
路由器
平
2022-02-06 05:40:41
1个回答
根据设计,127.0.0.0/8即使机器中没有网络适配器,网络也应该做出响应。
当您在该网络中 ping 一个地址时,它不会下到硬件层,甚至不会下到 L2。该请求在 TCP/IP 堆栈的 Internet(网络)层进行处理和响应。
因此,您无法在环回适配器以外的任何其他适配器上捕获它(除非您将环回适配器的端口镜像配置到另一个 NIC 或其他不使用的数据包转发设置)。
关于 0.0.0.0 地址
它是保留的,只能在初始化过程 IE DHCP / BOOTP 中用作源地址。
根据RFC1122,它不是有效的目标 IP 地址
主机是否会响应对 0.0.0.0 的 ping 取决于实现。Windows 和 MacOs 不处理它,而 Linux Debian 回应:
视窗
ping 0.0.0.0
Pinging 0.0.0.0 with 32 bytes of data:
PING: transmit failed. General failure.
PING: transmit failed. General failure.
苹果系统
~$ ping 0.0.0.0
PING 0.0.0.0 (0.0.0.0): 56 data bytes
ping: sendto: No route to host
Linux Debian
~$ ping 0.0.0.0
PING 0.0.0.0 (127.0.0.1) 56(84) bytes of data.
64 bytes from 127.0.0.1: icmp_req=1 ttl=64 time=0.038 ms
64 bytes from 127.0.0.1: icmp_req=2 ttl=64 time=0.015 ms



