Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

List ALL devices on local network?

I have tried arp -a a lot and it has listed some devices, but not all of them. ifconfig shows my ip address and mac address and some other useful information, but it doesn't show all of the devices on the local network. Is there a command that shows all IP addresses?

like image 817
Robert Moore Avatar asked Jun 04 '15 12:06

Robert Moore


People also ask

How can I see what computers are connected to my network?

Find computers in network using File ExplorerOpen File Explorer on Windows 10. Click on Network from the left pane. See computers available in the local network. Double-click the device to access its shared resources, such as shared folders or shared printers.

Can I see all devices connected to my wifi?

The best way to find this information will be to check your router's web interface. Your router hosts your Wi-Fi network, so it has the most accurate data about which devices are connected to it. Most of the best routers offer a way to view a list of connected devices, although some may not.


1 Answers

arp -a will show you only MAC addresses that are stored in local ARP cache and your computer was connected to. When I'm trying to see every device in my local network I have to scan it. For example if you have 192.168.1.0/24 network you can do:

$ for i in `seq 1 254`; do
ping -c 1 -q 192.168.1.$i &
done

You will try to ping every computer in your network. Of course not every computer will answer for ping. This is why you can't rely on ping. Now you need to check ARP cache.

$ arp -a | grep 192.168.1. | grep ether

This command will show you ARP cache filtered only with computers that are in this network and that answered on ARP requests (in 99% cases it will be full list of devices in your network - just remember that ARP entry is not removed immediately when the device disconnects).

like image 129
Krzysztof Sawicki Avatar answered Sep 21 '22 01:09

Krzysztof Sawicki