nmap for scan network

First we need to find IP address range of the network, we can use any of the commands ifconfig , ip a

 

The important things are highlighted in bold. As you see my IP is 192.168.1.13 and the subnet mask is 255.255.255.0 which means that the ip address range on my network varies from 192.168.1.0 to 192.168.1.255.

We can use the command nmap with option -sn to view the devices and there IP addresses that connected in our network.

$ sudo nmap -sn 192.168.1.13/24