How to find un-used IP addresses in network?
Anyone have idea how can find avai开发者_StackOverflow社区lable IP addresses in a network using any protocol?
UDP broadcasting is one way. But in this case every one should have a listener app?
Please suggest if have any other way?
You could send ICMP pings to the broadcast network address. For example, if your interface IP is in the 192.168.0.0/24 network, you would send pings to 192.168.0.255 -
[22:45:54 jmac:~]$ ping 192.168.0.255
PING 192.168.0.255 (192.168.0.255): 56 data bytes
64 bytes from 192.168.0.12: icmp_seq=0 ttl=64 time=0.159 ms
64 bytes from 192.168.0.1: icmp_seq=0 ttl=64 time=99.708 ms
64 bytes from 192.168.0.12: icmp_seq=1 ttl=64 time=0.147 ms
However to send ICMP ping from an application, you'll need to open raw sockets & thus you'll need root permissions. The ping program on most OSes are setuid root programs, so they can be invoked by any user.
精彩评论