Finding IP addresses of devices in your network using port scan

I was  trying to find the IP address of a device which was connected to the network and had secured the IP address using DHCP.

The easiest way to check was to look for the DHCP Server logs, but since that was not possible I did a port scan. Here are the simple steps on Ubuntu.

This will only work if you know that the particular PC has certain services running such as SSH, only then will this step work as you can search for devices with a particular port open.

First insall nmap, which is a port scanning utility. You can either use Ubuntu Software Software or type apt-get install nmap

Now go to Applications-Accessories-Terminal and type this.

nmap -v -p22 192.168.1.1-255  | grep open

This showed me all devices where port 22 was open.

-p = Port

22 = Port number, 22 is for ssh, 80 for http and so on. 

No spaces between -p and the port number.

If you don’t know which port to scan, this command will give you a list of services and port numbers:  cat /etc/services

192.168.1.1-255 is the range of IP addresses so this will scan all IPs  from 192.168.1.1 to 192.168.1.255

Note: This may show more than one device if there are other devices with similar ports open, so you would need to know which one you are looking for.

1 thought on “Finding IP addresses of devices in your network using port scan”

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

A note to our visitors

This website has updated its privacy policy in compliance with changes to European Union data protection law, for all members globally. We’ve also updated our Privacy Policy to give you more information about your rights and responsibilities with respect to your privacy and personal information. Please read this to review the updates about which cookies we use and what information we collect on our site. By continuing to use this site, you are agreeing to our updated privacy policy.

Scroll to Top