Sistema de blogs Diarium
Universidad de Salamanca
Pablo Gallardo's Blog
My professional web log about IT, Cybersecurity & Project Management

How to find the Devices on your Network with nmap

First of all, you need to know your IP and the network range where it belongs to.

It is important to perform scanning that you understand the meaning of IPv4 addresses. You can check this post explaining about it.

Open a terminal and type the following command to get your IP:


First, locate what the relevant network adapter you want to focus on (ethernet, wifi, etc.).

Find the values located in “inet” and “netmask” fields.

In our example, we assume that inet value was and netmask value was

Get the network IP by applying the mask to your IP.

For example, if your IP is and mask is, the network IP would be

Translate the value in netmask to the decimal number of positions with value 1.

For example,, that is in binary 11111111.11111111.11111111.00000000, has 24 ones, so it would become number 24.

The network to scan would be the network IP with a slash and the number of decimal positions for the network.

In our example, it would be

Then apply this command to find the devices on your network with nmap:

nmap -sN <range of IPs to sweep>

The -sN parameter informs that we just want to perform a ping sweep of all the addresses, not to scan ports yet.

In our example, it would be:

nmap -sN

Another command meaning the same would be:

nmap -sN

The output would indicate the IPs of the devices in our network.



You can also try this simple command to find the devices on your network:
netdiscover -i eth0


External references


About pmgallardo

I studied Computer Science at University of Salamanca. Since then, I have been working first as developer and then as SAP consutant. This blog is about problems I dealt when using computers, and more important, the solutions I found. Whenever I am on an issue and suddenlly I have a flash that leads me to a solution, I document my discoveries in a post.

, , , , , , , , , ,

No comments yet.

Leave a Reply


Política de privacidad
Studii Salmantini. Campus de excelencia internacional