Using Ubuntu 10.10, I was wondering if there was a command line command that can list all the IPs of devices connected to the network?

I would use this for example, to list all the computers connected to my home network. Ideally, it needs to be command line as I will be running it from C++.

Any ideas?

link|improve this question

75% accept rate
feedback

3 Answers

up vote 6 down vote accepted

Check out the arp-scan command - you will probably have to install it eg: sudo apt-get install arp-scan

http://manpages.ubuntu.com/manpages/hardy/man1/arp-scan.1.html

link|improve this answer
Perfect, thank you. Returns exactly the format I need. – Christopher Gwilliams Mar 24 '11 at 14:09
feedback

Use nmap. e.g.: nmap -sP 10.10.10.0/24 The arp cache will only tell you those that you have tried to contact recently.

link|improve this answer
feedback

In windows this would be "arp -a" I believe that an equivalent of that in Linux would be "arp -e".

This information was found here.

link|improve this answer
That looks like it works (may need to have a play as I am on a public network so it only seems to list all the servers on the network. – Christopher Gwilliams Mar 24 '11 at 13:37
If I am on a home network, will it just list the devices connected to my router? Thanks! – Christopher Gwilliams Mar 24 '11 at 13:37
That command will only list the devices in the hosts current arp cache and that will only be the ones which the host has contacted recently. – Linker3000 Mar 24 '11 at 13:38
feedback

Your Answer

 
or
required, but never shown

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