DylanPiercey / local-devices

🔮 Find devices connected to the current local network.
MIT License
139 stars 27 forks source link

Howto Search by Partial Mac Address #20

Closed darioajr closed 2 years ago

darioajr commented 4 years ago

I need search in my network all raspberry pi devices, the mac address begin with b8:27:eb........

natterstefan commented 4 years ago

Hi @darioajr,

currently, this is not possible with our package out of the box, but it could definitely be an interesting feature for us. Feel free to contribute by creating a PR including this idea.

You could run arp -na for instance and parse the result accordingly. Example output on macOS:

Screenshot 2019-11-19 at 21 30 45

Or you need to figure out how to use these commands in your node app to make it work:

  1. install nmap and run the following command: sudo nmap -sP 192.168.0.0/24 | awk '/^Nmap/{print}/B8:27:EB/{print}' (maybe with https://www.npmjs.com/package/libnmap)
  2. on MacOS arp -na | grep -i b8:27:eb or Linux arp -a | findstr b8-27-eb

Sources: