前几天遇到个需求,要探测局域网内 PC机的 IP,有可能跨网段,但是在同一个交换机;于是果断从网上下载了一个DEMO,可以填写探测的IP地址范围,扫描出范围内的主机IP; 抓包看了下,发现一堆icmp包,看来是通过枚举ping实现的;
准备交差的时候被告知 负责探测的主机并不知道其他主机的IP,也不知道IP子网掩码和网关什么的,这样的话没法填写IP段,下载的这个DEMO就没什么用了......然后找了下设备同事,得知可以通过ARP广播实现;但是我印象中广播是不能跨网段的,只能在本子网中进行广播,但是同事又说是可以的,所以只能百度了,度娘解释如下:
1)受限广播
IP地址的网络字段和主机字段全为1就是地址255.255.255.255;
2)直接广播
网络广播会被路由,并会发送到专门网络上