Linux - Find other computers on your network

By xngo on October 18, 2020

Find your IP address

I ran ifconfig command to find out that my IP address is 192.168.1.16

ifconfig
# wlp3s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
#         inet 192.168.1.16  netmask 255.255.255.0  broadcast 192.168.1.255
#         inet6 fe80::bb94:a6ff:fcd5:3ea1  prefixlen 64  scopeid 0x20<link>
#         ether e8:78:f6:c7:7a:f1  txqueuelen 1000  (Ethernet)
#         RX packets 947533  bytes 808159752 (770.7 MiB)
#         RX errors 0  dropped 0  overruns 0  frame 0
#         TX packets 330219  bytes 42886507 (40.8 MiB)
#         TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

Scan network

To scan for other devices or computers connected on the same network, I used nmap utility. I installed it using apt-get install nmap. I scanned all IP addresses under 192.168.1 network as follows:

nmap -sL 192.168.1.*
# Nmap scan report for 192.168.1.0
# Nmap scan report for ControlPanel.Home (192.168.1.1)
# Nmap scan report for 192.168.1.2
# ...
# Nmap scan report for 192.168.1.13
# Nmap scan report for android-78854f3bd701a199 (192.168.1.14)
# Nmap scan report for 192.168.1.15
# Nmap scan report for 192.168.1.16
# Nmap scan report for 192.168.1.17
# Nmap scan report for MYCOMPUTER (192.168.1.18)
# ...
# Nmap scan report for 192.168.1.255
# Nmap done: 256 IP addresses (0 hosts up) scanned in 4.25 seconds

As you can see, there are 3 other devices on the network:

  • 192.168.1.1
  • 192.168.1.14
  • 192.168.1.18

About the author

Xuan Ngo is the founder of OpenWritings.net. He currently lives in Montreal, Canada. He loves to write about programming and open source subjects.