如何在IPv4关闭时检查子网IPv4地址是否未使用?

时间:2014-08-22 17:15:16

标签: linux networking ipv4

我发现了一些消息来源,建议我如何使用pingarpingnmap查找IP地址是否可用,但是当IPv4关闭时,所有这些解决方案都会失败。我想找到一种方法来自动检测IPv4地址是否可用,然后再将其分配给没有IPv4地址的新机器。例如,

$ sudo arping 192.168.2.205
ARPING 192.168.2.205
60 bytes from 00:50:56:91:a5:0d (192.168.2.205): index=0 time=730.931 msec
60 bytes from 00:50:56:91:a5:0d (192.168.2.205): index=1 time=362.976 msec
60 bytes from 00:50:56:91:a5:0d (192.168.2.205): index=2 time=730.205 msec
^C
--- 192.168.2.205 statistics ---
4 packets transmitted, 3 packets received,  25% unanswered (0 extra)
$ sudo ifconfig eth0 0.0.0.0
$ sudo arping 192.168.2.205
arping: Unable to automatically find interface to use. Is it on the local LAN?
arping: Use -i to manually specify interface. Guessing interface eth0.
arping: Unable to get the IPv4 address of interface eth0:
arping: libnet_get_ipaddr4(): ioctl(): Cannot assign requested address
arping: Use -S to specify address manually.

有没有办法实现这个目标?

0 个答案:

没有答案