我的网络设备未收到广播消息

Broadcast message not recived by my network device

我想列出我本地网络中存在的所有有效 IP。为此,我尝试固定我的广播地址,然后查询 ARP table。在执行某些网络设备时,IP 地址未在 ARP table 中列出。如果我对那个特定的 ip 地址执行 ping 命令,那么如果我查询 ARP table,那些就会被列出。为什么会有这样的行为?

ARP-table 只是一个缓存,让您的机器在您每次尝试访问另一台机器时跳过 ARP 查找。因此,如果您还没有与特定的 IP-address 通信,那么在 ARP-table 中将不会有关于该特定的 IP-address 和对应的 MAC.

的记录

如果您 运行 例如 WireShark,您会看到您的机器(如果您是第一次与机器通信)将发送广播消息,或多或少地说明“谁拥有 192.168. 0.4(只是一个例子)- 回复 192.168.0.19)。当回复返回时,它会在 ARP table.

中存储 MAC 和相应的 IP

有关这方面的更多信息,请查看此处: http://www.tummy.com/articles/networking-basics-how-arp-works/

While doing some network devices ip addresses are not getting listed in ARP table. If I do ping that particular ip address then if i query ARP table those are getting listed. Why such behaviour ?

主机可以并且经常被配置为忽略广播 ping。至少对于某些(我想说“大多数”)Linux 发行版和 Windows 版本来说,这是默认设置。 RFC 1122(第 3.2.2.6 节)明确允许这样做。

I want to list all the valid ip present in my local network.

为此,您可以尝试(单播)ping each host on your subnet, or run a host discovery with nmap