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 ?

20
  • That's strange. The command you show should have worked. Are you sure the other devices are on the same network? Is their IP address 192.168.1.XX?
    – terdon
    Sep 21, 2015 at 22:55
  • Yes, the other devices are connected same modem in my room. But command couldn't find. I'm triying last 2 ours.
    – m.tuğrul
    Sep 21, 2015 at 22:57
  • Use sudo before the nmap command as TCP SYN packets are sent to only ports 80 and 443 when nmap -sP is run as unprivileged user..
    – heemayl
    Sep 21, 2015 at 23:00
  • I wanna ask one thing, when I start working on terminal, I do sudo su and I work as root. I'm new on Linux. Is not it same?
    – m.tuğrul
    Sep 21, 2015 at 23:02

3 Answers 3

2

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

sudo arp-scan -l

5
  • Doesn't exists other way? I'll try your solution but Can't we do that without tools?
    – m.tuğrul
    Sep 21, 2015 at 22:55
  • you'll probably need to run something. I'm not sure what you mean with "tools" though.
    – user448115
    Sep 21, 2015 at 22:58
  • Is arp-scan a tool like nmap developed by some guy or I understand wrong this?
    – m.tuğrul
    Sep 21, 2015 at 23:00
  • every piece of software is developed by "some guy" afaik.
    – user448115
    Sep 21, 2015 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, 2015 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
3
  • Is interface a parameter or value? Should I run same form yours?
    – m.tuğrul
    Sep 22, 2015 at 16:19
  • There was an extra space before that 'i', sorry about that. I removed it.
    – Root
    Sep 22, 2015 at 16:21
  • Doesn't matter, thank u so much, I'll try when I arrive to home
    – m.tuğrul
    Sep 26, 2015 at 22:11
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.

1
  • 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, 2015 at 23:04

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .