Question

Is there a terminal command line [on OS X] for scanning nearby mac addresses? Not the airport that lists the SSIDs of nearby routers, but something to list the devices [like phones].

I want to use it to run a cron and run a script every time a specific device comes into range.

Thanks!

Was it helpful?

Solution 3

Speaking only about Wi-Fi protocol (802.11n) there is no way for a STA to find the others STAs. A STA can only scan for APs.

But there is a new Wi-Fi protocol called Wi-Fi Direct in which you can search for PEERs. In this case, the other devices needs to have Wi-Fi Direct enabled ...

If you want to use only the "default" Wi-Fi, you can sniff all channels and check for probe request frames. But it's not straightforward.

Note: I assume that we are only in "infrastructure mode" cause the "ad-hoc mode" is not very used

OTHER TIPS

Have a try with the following:

arp -a

Sample output:

router.asus.com (192.168.0.1) at 8:60:6e:ba:17:c8 on en0 ifscope [ethernet]
vmubuntu (192.168.0.9) at (incomplete) on en0 ifscope [ethernet]
? (192.168.0.225) at 0:a0:96:c7:8a:c1 on en0 ifscope [ethernet]
? (192.168.0.255) at ff:ff:ff:ff:ff:ff on en0 ifscope [ethernet]

There is a product I use on my iPhone, and there is apparently also an OSX version. It's called "fing" and it scans your network and tells you the MAC addresses of attached devices - it can also send Wake-on-LAN packets - which is what I use it for.

See Fing here.

Note: I wouldn't normally recommend 3rd party paid apps (see my other answer in which I suggested "arp"), and I have no connection with these guys and derive nothing from mentioning them - I just feel their product may help you out.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top