Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Possible Duplicate:
How to find unused IP Address on a network?

currently I am using nmap wich scans the range of IPs that my DHCP server assigns to hosts. However this is a) slow and b) sometimes nmaps doesn't discover all hosts. Laptops that are connected wirelessly sometimes aren't counted.

I tried almost all possible nmap scan techniques like:

sP,sS, sT, sW, sM etc... they all miss out the laptops sometimes although I can ping them at any time.

I am looking for an efficient way to accomplish this without missing out some hosts. My Router is a Linksys WRT54GL and I am using the latest Tomato firmware.

share|improve this question

marked as duplicate by Bruno Pereira, James, jokerdino, Octavian Damiean, Jjed Feb 1 '12 at 17:44

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

sudo nmap -sP -PR 192.168.0.* shold return all IP from the network no mather what. Can you check if you are using sudo on the command, you get different results if not. – Bruno Pereira Dec 8 '11 at 21:24
Its not an exact, its the opposite but the solutions are really common. – Bruno Pereira Dec 8 '11 at 21:31
Yes even with sudo the laptop isn't discovered sometimes. – imbaer Dec 8 '11 at 21:33
How about looking it up from the router itself? If you login to most routers, you can see a list of connected devices pretty quickly. – Tom Brossman Dec 8 '11 at 21:35
But has to be from the command line :) Sorry didn't say that in the question. – imbaer Dec 8 '11 at 21:49
up vote 3 down vote accepted

You can also try arp-scan (install using sudo apt-get install arp-scan on a terminal)

It returns MAC addresses and tries to find the manufacturer of the network adapter.

ie, sudo arp-scan --retry=8 --ignoredups -I eth0 (--ignoredumps and --retry=8 make the results more accurate) returns

Interface: eth0, datalink type: EN10MB (Ethernet)
Starting arp-scan 1.8.1 with 256 hosts ( 68:7f:74:a5:07:18   Cisco-Linksys, LLC 00:11:32:07:71:ac   Synology Incorporated   00:21:9b:f8:ec:1c   Dell Inc   00:12:fb:1a:88:8a   Samsung Electronics

4 packets received by filter, 0 packets dropped by kernel
Ending arp-scan 1.8.1: 256 hosts scanned in 1.377 seconds (185.91 hosts/sec). 4 responded

Give it a try.

share|improve this answer
Looks good so far, I'll evaluate it a little more and check back tomorrow. – imbaer Dec 8 '11 at 21:36
With the --retry option combined with --ignoredups this works like a charm. sudo arp-scan --retry=8 --ignoredups -I eth0 – imbaer Dec 9 '11 at 8:13
Nice! I will add it to the answer then. – Bruno Pereira Dec 9 '11 at 8:48

Not the answer you're looking for? Browse other questions tagged or ask your own question.