3

I tried to find all machines which are connected my modem. I tried 192.168.x.0/24 command on gnome-terminal but it couldn't find any. My brother's laptop and my mobile phone are already connected the modem but this command couldn't find them.

Here is the output :

root@tugrul:/home/tugrul# nmap -sP 192.168.1.0/24
Starting Nmap 6.40 ( http://nmap.org ) at 2015-09-22 01:40 EEST
Nmap scan report for 192.168.1.1
Host is up (0.0050s latency).
MAC Address: xx:xx:xx:xx:xx:xx (Shenzhen Zowee Technology Co.)
Nmap scan report for 192.168.x.x
Host is up.
Nmap done: 256 IP addresses (2 hosts up) scanned in 3.40 seconds

I also tried nmap -sn 192.168.6.0/24 but there was no difference:

$ nmap -sn 192.168.6.0/24
Nmap scan report for 192.168.1.1
Host is up (0.0043s latency).
MAC Address:  (Shenzhen Zowee Technology Co.)
Nmap scan report for 192.168.1.15
Host is up.
Nmap done: 256 IP addresses (2 hosts up) scanned in 3.06 seconds

How can I do that ?

3 Answers3

2

try arp-scan. install it by sudo apt install arp-scan:

sudo arp-scan -l

2

Use netdiscover

netdiscover -i <interface>

If you're trying to find the devices in the wifi network, the command would be

netdiscover -i wlan0
Root
  • 106
0

Your command should have worked. It does on my system anyway, as does arp-scan as suggested by Adonis. If, however, you don't want to install any tools, you could use a brute approach and just ping everything:

for i in 192.168.1.{1..100}; do 
    ping -w 1 -c 1 $i >/dev/null && echo "$i is up"; 
done

The command above will ping every IP between 192.168.1.1 and 192.168.1.100. If a host is pingable (if it is connected), it will print the host's name.

However, this will be slow and cumbersome and is not really a good solution. Use arp-scan or nmap as you did instead.

Pang
  • 373
terdon
  • 104,119