Wednesday, February 22, 2012

Find out what IPs are on your subnet


Here is a quick tip on how to find out what host IPs are on your subnet using nmap. This is useful to find out what IPs are being used or just to know how many devices are connected to the subnet.

How to find out what IPs are being used on your subnet

# nmap -v -sP 192.168.1.0/24
You can replace the 192.168.1.0/24 address with whatever your IP and subnet is.
Also, for a cleaner output that removes the lines that tell you an IP is not used, try the following:

# nmap -v -sP 192.168.1.0/24 | grep -v "appears to be down"