There might be cases where you want to determine if unwanted users not using your wireless network or to find all devices connected to your network. Nmap is one of the ways to do that. Nmap is a cross-platform tool that allows to scan networks via command line.
To determine which devices are connected to local network, first we need to get IP range of the network. On Linux we can use
ip addr show
On windows we can use
In our case, subnet mask is 255.255.255.0 = 24 and network IP range is from 192.168.0.0 to 192.168.0.255.
Now we can run
nmap command to find which devices are connected to local network:
nmap -sn 192.168.0.0/24
On Linux this command will show only the IP addresses. Execute the command as superuser to include the MAC address of each device as well.
sudo nmap -sn 192.168.0.0/24
-sn option means that port scanning will be skipped. In previous Nmap releases,
-sn was available as