How to find all the used IP addresses on a network
Generally, nmap
is quite useful to quickly scan networks.
To install nmap, enter the following command in the terminal:
sudo apt-get install nmap
Once the application is installed, enter the following command:
nmap -sn 192.168.1.0/24
This will show you which hosts responded to ping requests on the network between 192.168.1.0 and 192.168.1.255.
For older versions of Nmap, use -sP
:
nmap -sP 192.168.1.0/24
For additional references, see the following pages:
NMAP Installation Guide
NMAP Reference Guide
It is a very useful tool to learn.
If all the computers in your network are Ubuntu or any other distribution that makes use of avahi-daemon
(DNS-SD), you can get a detailed list of them (with hostname and IP address) by doing:
avahi-browse -rt _workstation._tcp
If you want to know all the IP addresses used in your network, you can use arp-scan
:
sudo arp-scan 192.168.1.0/24
As it is not installed by default, you'll have to install it with sudo apt-get install arp-scan
. arp-scan
send ARP packets to the local network and displays the responses received, so it shows even firewalled hosts (that block traffic based on IP packets).