Finding a device on your network is an important task. It is a good idea to keep an eye on which machines are on your network and what they are doing.
Even if we know the hostname or IP address of a machine, we can connect to it remotely, for example via SSH† For example, if you have a raspberry pi connected but can’t remember the name, scanning the network will give you that information.
In this how-to, we’ll learn the different ways to scan your home network and find the machines on it. To illustrate the task, let’s look for a Raspberry Pi with the latest version of Raspberry Pi OS.
Find network devices through your router
Every router is a little different, but most provide a way to list all the devices on your network. To see this, you need to log into your router and navigate through the options looking for “Devices”. Here we can see the device name (host name) and IP address of machines on our network.
Find network devices through an app
Our preference is to use an app that searches our network and gets the details for us. We have been using Fing on our Android devices for many years and it reliably returns the details of network devices. Fing also offers an app for Windows and Mac.
1. Download and install fing for your operating system.
2. create an account and follow the signup process.
3. Open Fing and click on Devices†
4. Click Refresh to perform a search for network devices.
5. Click on the device you want to connect to. Our example uses a Raspberry Pi.
The hostname and IP address are now visible. Our hostname was “raspberrypi”, and we have two IP addresses because our Pi is connected via Wi-Fi and Ethernet.
6. Scroll down and click Find open ports to start a scan.
7. An optional step. Scroll down the page, click Find open ports to perform a port scan of the device. SSH is traditionally set to port 22.
Scan for network devices in Linux and MacOS
Linux users can use nmap, a network scan tool, to search for all the devices on their home network and then list their open ports. Here we are using an Ubuntu 22.04 installation.
1. Open a terminal and update the list of software sources†
sudo apt update
2. Install nmap using the apt package manager.
sudo apt install nmap
3. Using sudo, call the nmap command with the argument -Pn to scan all IP addresses on your network. Our network uses the IP range 192.168.0.0 to 192.168.0.255, your network may not. Adjust the IP address range to suit your network.
sudo nmap -Pn 192.168.0.0/24
4. Scroll through the returned results to: find the device you want to SSH to. Our target was a Raspberry Pi and we can see two IP addresses that match. Both are the same machine, connected via Wi-Fi and Ethernet.