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

  • Doesn't exists other way? I'll try your solution but Can't we do that without tools? – m.tuğrul Sep 21 '15 at 22:55
  • you'll probably need to run something. I'm not sure what you mean with "tools" though. –  Sep 21 '15 at 22:58
  • Is arp-scan a tool like nmap developed by some guy or I understand wrong this? – m.tuğrul Sep 21 '15 at 23:00
  • every piece of software is developed by "some guy" afaik. –  Sep 21 '15 at 23:07
  • thank you for your interest, I tried but it doesn't find other devices. I checked the other devices, they are connected but I couldn't find with arp-scan or my way. Thank you again – m.tuğrul Sep 21 '15 at 23:10
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,404
  • Thank you for your interest, all of you. Why isn't my command working on my network but working on yours? It made me crazy. – m.tuğrul Sep 21 '15 at 23:04