Neat and fast way to count devices in home network

5,620

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 192.168.1.0/24 (--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 (http://www.nta-monitor.com/tools/arp-scan/)
192.168.1.1 68:7f:74:a5:07:18   Cisco-Linksys, LLC
192.168.1.5 00:11:32:07:71:ac   Synology Incorporated
192.168.1.100   00:21:9b:f8:ec:1c   Dell Inc
192.168.1.117   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:
5,620

Related videos on Youtube

imbaer
Author by

imbaer

Updated on September 18, 2022

Comments

  • imbaer
    imbaer almost 2 years

    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.

    • Bruno Pereira
      Bruno Pereira over 12 years
      sudo nmap -sP -PR 192.168.0.* shold return all IP from the 192.168.0.0 network no mather what. Can you check if you are using sudo on the command, you get different results if not.
    • Bruno Pereira
      Bruno Pereira over 12 years
      Its not an exact, its the opposite but the solutions are really common.
    • imbaer
      imbaer over 12 years
      Yes even with sudo the laptop isn't discovered sometimes.
    • Sanam Patel
      Sanam Patel over 12 years
      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.
    • Mike678
      Mike678 over 12 years
      BTW: may I ask which operating system the laptos used while scanning with nmap? If they are common or widely used, are there any ports open, ping disabled or some other configuration to hide them?
    • imbaer
      imbaer over 12 years
      I can ping any of them. Its an android (gingerbread cynogenmod 7.1) device, one windows 7 laptop, one windows 7 pc (wireless) and one Ubuntu laptop. They are all missed out occasionally by both nmao and arp-scan. However as I mentioned in the accepted answer with --retry=8 and --ignoredups I can work around that.
  • imbaer
    imbaer over 12 years
    Looks good so far, I'll evaluate it a little more and check back tomorrow.
  • imbaer
    imbaer over 12 years
    With the --retry option combined with --ignoredups this works like a charm. sudo arp-scan --retry=8 --ignoredups -I eth0 192.168.0.100-192.168.0.150
  • Bruno Pereira
    Bruno Pereira over 12 years
    Nice! I will add it to the answer then.