Find Devices Connected to Your Network with nmap on Ubuntu 22.04 (2024)

Find Devices Connected to Your Network with nmap on Ubuntu 22.04 (1)

As Ubuntu users, we may want to know if we are the only ones using our network, especially the WLAN, or if there are other unwanted users exploiting our network bandwidth. This capability and knowledge are also helpful when we want to be sure that no hacker is accessing our system by connecting to our network.

Scan your network with Nmap on Ubuntu

This article describes step by step how to use the Nmap tool, which provides you with a list of all devices connected to your network. We have run the commands and procedures described in this article on Ubuntu 22.04 LTS.

Step 1: Open the Ubuntu command line

We will be using the Ubuntu command line, the Terminal, in order to view the devices connected to our network. Open the Terminal either through the system Dash or the Ctrl+Alt+T shortcut.

Step 2: Install the network scanning tool Nmap

When it comes to reliable network scanning, Nmap is a tool that you can totally depend on.

Enter the following command as sudo in the Terminal application in order to install the tool.

Find Devices Connected to Your Network with nmap on Ubuntu 22.04 (2)

The system will ask you for the password for sudo since only an authorized user can install/uninstall and configure software on Ubuntu.

The system will also ask you to confirm the installation with y/n. Please type y and press enter to start the installation process.

Step 3: Determine the IP range/subnet mask of your network

To know which devices are connected to your network, you first need to determine the IP range or subnet mask of your network. We will use the ifconfig command to determine this IP. To run the ifconfig command, we need to install the net-tools package on our Ubuntu server or desktop. Use the following command to install net-tools if you do not already have it installed on your system:

$ sudo apt install net-tools

Find Devices Connected to Your Network with nmap on Ubuntu 22.04 (3)

The system will prompt you with a y/n option to confirm the installation. Please enter Y and hit enter to begin the installation process.

Once you have the net-tools utility available, run the following command to get information about the network(s) your system is connected to:

$ ifconfig

Find Devices Connected to Your Network with nmap on Ubuntu 22.04 (4)

The highlighted IP in the output shows that our system uses the subnet mask 192.168.100.0, and the range is 255. So our network IP range is from 192.168.100.0 to 192.168.100.255.

Alternative Installation via Ubuntu GUI

Instead of using the ifconfig tool, you can also get the subnet mask from the Ubuntu user interface.

Access the settings utility in System Dash and check the details of your network by clicking on the settings icon next to the WLAN or Ethernet network you are connected to.

Find Devices Connected to Your Network with nmap on Ubuntu 22.04 (5)

In this example, we have checked the settings of a wi-fi network we are currently connected to.

Find Devices Connected to Your Network with nmap on Ubuntu 22.04 (6)

The highlighted ipv4 address or the Default Route address indicates that we are connected to a subnet IP 192.168.100.0

Step 4: Scan the network for the connected device(s) with Nmap

Through the Nmap tool, you can scan the report of all devices connected to a network by providing the subnet mask IP as follows:

$ nmap -sP 192.168.100.0/24

Find Devices Connected to Your Network with nmap on Ubuntu 22.04 (7)

The output shows that three devices are connected to the network: the router itself, the Linux system I use on my laptop, and my phone.

Step 5: Exit the terminal

Use the following command to exit the terminal application after extracting the information you need:

$ exit

In this article, you learned how an Ubuntu user could install and use the Nmap command. We showed you how to see which devices are connected to your network. This way, you can verify that no unauthorized device is connected to your network.

Find Devices Connected to Your Network with nmap on Ubuntu 22.04 (2024)
Top Articles
Latest Posts
Article information

Author: Chrissy Homenick

Last Updated:

Views: 6873

Rating: 4.3 / 5 (74 voted)

Reviews: 89% of readers found this page helpful

Author information

Name: Chrissy Homenick

Birthday: 2001-10-22

Address: 611 Kuhn Oval, Feltonbury, NY 02783-3818

Phone: +96619177651654

Job: Mining Representative

Hobby: amateur radio, Sculling, Knife making, Gardening, Watching movies, Gunsmithing, Video gaming

Introduction: My name is Chrissy Homenick, I am a tender, funny, determined, tender, glorious, fancy, enthusiastic person who loves writing and wants to share my knowledge and understanding with you.