I’m trying to make a very simple Raspberry Pi application that would auto-update with all the IP addresses, Mac addresses, and their respective device names that are all on the same network. I have absolutely no idea where to start, any recommendations on how to get this done?
I play to connect a LCD and mount it next to my router so I have easy access to all the devices that are connected to my network.
Thanks for the help!
Advertisement
Answer
How about “arp-scan” command?
$ sudo apt-get install arp-scan $ sudo arp-scan -l --interface wlan0 Interface: wlan0, datalink type: EN10MB (Ethernet) Starting arp-scan 1.8.1 with 256 hosts (http://www.nta-monitor.com/tools/arp-scan/) 192.168.0.211 14:da:e9:XX:YY:ZZ (Unknown) 192.168.0.1 1c:b1:7f:XX:YY:ZZ (Unknown) 192.168.0.201 1c:ba:8c:XX:YY:ZZ (Unknown) 192.168.0.202 e8:9d:87:XX:YY:ZZ Toshiba 192.168.0.203 00:25:dc:XX:YY:ZZ Sumitomo Electric Networks, Inc 192.168.0.210 fc:c2:de:XX:YY:ZZ (Unknown) 192.168.0.212 64:bc:0c:XX:YY:ZZ (Unknown) 192.168.0.207 10:6f:3f:XX:YY:ZZ (Unknown) 192.168.0.208 90:a2:da:XX:YY:ZZ GHEO SA 192.168.0.205 48:5d:60:XX:YY:ZZ Azurewave Technologies, Inc. 192.168.0.210 fc:c2:de:XX:YY:ZZ (Unknown) (DUP: 2) 12 packets received by filter, 0 packets dropped by kernel Ending arp-scan 1.8.1: 256 hosts scanned in 5.247 seconds (48.79 hosts/sec). 11 responded
Your interface might be eth0 instead of wlan0.
(Added) Because the arp-scan package contains an old vendor list file, many devices fail to get their name (represented as “(Unknown)”). To correct that:
$ git clone https://github.com/royhills/arp-scan.git $ sudo cp /usr/share/arp-scan/ieee-oui.txt{,.org} $ sudo cp arp-scan/ieee-oui.txt /usr/share/arp-scan/
After refreshing the file, we can get the output like the following:
$ sudo arp-scan -l --interface wlan0 Interface: wlan0, datalink type: EN10MB (Ethernet) Starting arp-scan 1.8.1 with 256 hosts (http://www.nta-monitor.com/tools/arp-scan/) 192.168.0.211 14:da:e9:XX:YY:ZZ ASUSTek COMPUTER INC. 192.168.0.1 1c:b1:7f:XX:YY:ZZ NEC Platforms, Ltd. 192.168.0.201 1c:ba:8c:XX:YY:ZZ Texas Instruments 192.168.0.202 e8:9d:87:XX:YY:ZZ Toshiba 192.168.0.203 00:25:dc:XX:YY:ZZ Sumitomo Electric Industries,Ltd 192.168.0.205 48:5d:60:XX:YY:ZZ AzureWave Technology Inc. 192.168.0.210 fc:c2:de:XX:YY:ZZ Murata Manufacturing Co., Ltd. 192.168.0.212 64:bc:0c:XX:YY:ZZ LG Electronics 192.168.0.208 90:a2:da:XX:YY:ZZ GHEO SA 192.168.0.207 10:6f:3f:XX:YY:ZZ BUFFALO.INC 11 packets received by filter, 0 packets dropped by kernel Ending arp-scan 1.8.1: 256 hosts scanned in 5.750 seconds (44.52 hosts/sec). 10 responded
All devices correctly got their (vendor) name.