I just want to find out unused IP Address on a network. I think it is possible with nmap. Can any one say me the way pls?
Note:
I just need the free IP list alone.
I just want to find out unused IP Address on a network. I think it is possible with nmap. Can any one say me the way pls?
Note:
I just need the free IP list alone.
A fast scanner is arp-scan which uses ARP to "see" other machines on a network. It also returns the MAC address and tries to determine the manufacturer of the network adapter.
Example usage (replace
wlan0
byeth0
if needed):Note that this utility only reports machines which are powered on.
ping
can be blocked, butarp-scan
cannot be blocked since it's necessary for a machine to interact with other machines on a network. To be sure that an IP is unused, you'd better look at your router (for static/dynamic addresses) and DHCP server (for dynamic addresses).sudo nmap -sP -PR 192.168.0.*
(or whatever your network is) will do the trick.To install it use
sudo apt-get install nmap
.Source: serverfault.com.
Just tested this, works like a charm including obscured hosts, you need to add sudo to be able to use the
-PR
option.I find fping useful; among other things, it will ping a range of addresses and list which are 'alive' and which are 'unreachable'. fping is not installed by default.
The simple approach is to just run it over a range of addresses.
A bit more elaborately, to produce a list of unused IPs.
I believe it is not the best solution but it does what you want. This script runs
ping
over192.168.0.0/24
network and returns list of inactive IPs if there are not in ARP cache.Advantages over previous solutions:
root
userTo scan your network run it with
<first IP> <last IP>
parameters.Update after downvote
I wrote it because
nmap -PR 192.168.0.*
did not work for me:Update 2
Fixed all the issues with ARP-cache.
This should do it right in bash:
i think it is simpler