如何找到网络中未使用的IP地址? [英] How to find un-used IP addresses in network?

查看:264
本文介绍了如何找到网络中未使用的IP地址?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

任何人有任何想法如何可以使用任何协议的网络中,可以找到可用的IP地址?

Anyone have idea how can find available IP addresses in a network using any protocol?

UDP广播是一种方法。但在这种情况下,每个人都应该有一个监听器的应用程序?

UDP broadcasting is one way. But in this case every one should have a listener app?

请建议如果有任何其他方式?

Please suggest if have any other way?

推荐答案

您可以发送ICMP的ping到广播网络地址。例如,如果你的接口IP是192.168.0.0/24网络中,你会送坪到192.168.0.255 -

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

不过,从一个应用程序发送ICMP的ping,你需要打开原始套接字和放大器;因此,你需要root权限。在大多数操作系统ping程序是setuid root的程序,这样他们就可以被任何用户调用。

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.

这篇关于如何找到网络中未使用的IP地址?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆