قالب وردپرس درنا توس
Home / Tips and Tricks / View all devices on your network using nmap on Linux

View all devices on your network using nmap on Linux

  Ethernet Cables Connected to a Router
sirtravelalot / Shutterstock.com

Do you know what's connected to your home network? You might be surprised. Learn how to check nmap on Linux to explore all devices connected to your network.

You may find your home network quite simple, and there's nothing to learn if you have one. Take a closer look. You may be right, but there is a chance you might learn something you do not know. With the proliferation of Internet of Things devices, mobile devices such as phones and tablets, and the smart home revolution ̵

1; in addition to "normal" networking devices such as broadband routers, laptops, and desktop computers – this could be an eye-opener.

Install nmap if necessary

We will use the command nmap . Depending on what other software packages you have installed on your computer, nmap may already be installed for you.

Otherwise, you can install it on Ubuntu as follows.

  sudo apt-get install nmap 

  sudo apt-get installs nmap in a terminal window

How to install it on Fedora.

  sudo dnf installs nmap 

  sudo dnf installs nmap in a terminal window

How to install it on Manjaro.

  sudo pacman -Syu nmap 

  sudo pacman -Syu nmap in a terminal window

You can install it with the package on other Linux versions Manager for your Linux distributions.

Find your IP address.

The first task is to determine the IP address of your Linux computer. There is a minimum and a maximum IP address that your network can use. This is the scope or range of IP addresses for your network. We need to provide IP addresses or a range of IP addresses for nmap so we need to know what those values ​​are.

Linux handy provides a command named ip and There is an option called addr (address). Type ip a space, addr and press Enter.

  ip addr 

  ip addr in a terminal window

At the bottom of the output you will find your IP address. Before that is the label "inet".

 IP address output in a terminal window "width =" 646 "height =" 352 "src =" /pagespeed_static/1.JiBnMqyl6S.gif "onload =" pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon (this); "onerror =" this.onerror = null; pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon (this);

The IP address of this computer is 192.168 "/ 24" means that the subnet mask contains three consecutive sets of eight ones (and 3 x 8 = 24).

In binary notation the subnet mask:


and the decimal representation

The subnet mask and the IP address are used to indicate which part of the IP address the network and which part of the device are This subnet mask informs the hardware that the first three digits of the IP address identify the network and the last part of the IP address identifies each device, and the largest number that you can store in an 8-bit binary number , 255, the IP address range for this network ranges from to

All this is encapsulated in "/ 24." Fortunately, nmap works with this notation So what we need to start using nmap .

RELATED: How do IP addresses work?

Getting Started with nmap

nmap is a network mapping tool. It works by sending various network messages to the IP addresses in the area where we will deploy them. Much can be deduced about the device being tested by assessing and interpreting the nature of the responses received.

Let's start a simple scan with nmap . We will use the option -sn (Scan no Port). This indicates nmap not to test the ports of the devices for the time being. An easier, faster scan is performed. Nevertheless, it may take a while for nmap to be executed. The more devices are in the network, the longer it takes, of course. It will first do all the exploratory and reconnaissance work and present its results as soon as the first phase is completed. Do not be surprised if nothing is visible for a minute or so.

The IP address we are going to use is the one we received earlier with the command ip but the final number is set to zero. This is the first possible IP address in this network. The "/ 24" instructs nmap to scan the entire area of ​​this network. The parameter "" means "Start with the IP address and work through all IP addresses up to and including"

Note: We use sudo .

  sudo nmap -sn[19659027[19459037[sudonmap-sn19216840/24inaterminalwindow" width="646" height="57" src="/pagespeed_static/1.JiBnMqyl6S.gif" onload="pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);" onerror="this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);"/> 

After a short wait, the output is written to the terminal window.

You can run this scan without using sudo but using sudo will ensure that as much information as possible is extracted. For example, without sudo this scan would not return manufacturer information.

<img class = "alignnone size-full wp-image-426853" data-pagespeed-lazy-src = "https://www.howtogeek.com/wp-content/uploads/2019/06/xnmap_19.png .pagespeed.gp + jp + jw + pj + ws + js + rj + rp + rw + ri + cp + md.ic.vxdBbmXa66.png "alt =" nmap output in a terminal window "width =" 646 "height = "382" src = "/pagespeed_static/1 .JiBnMqyl6S.gif" onload = "pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon (this);" onerror = "this.onerror = null; pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon (this);

Source link