Home > Software engineering >  scanning multiple MAC address to find ip address using arp-scan
scanning multiple MAC address to find ip address using arp-scan

Time:02-01

I'm using this sudo arp-scan --localnet | awk '/b8:27:/ { print $1 }' to find Raspberry pi on my network base on the Mac address range and I was wondering how can I diplay multiple awk print results using one single line and multiple Mac without repeating the same command?

Raspberry pi's uses the following range for Raspberry pi's.

dc:a6:

b8:27:

e4:5f:

28:cd:c1:

This works but only with one single Mac.

sudo arp-scan --localnet | awk '/b8:27:/ { print $1 }'

CodePudding user response:

Just add them all to the regex (at least that's what I think you were asking for, your question isn't very well worded) - the pipe | functions as an or:

sudo arp-scan --localnet | awk '/b8:27:|dc:a6:|e4:5f:|28:cd:c1:/ { print $1 }'
  • Related