How can we get the BSSID value for a wifi network without sudo

We are looking to get BSSID value for a wifi network from terminal as this needs to be used in automation script.Currently when running /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -I ,it gives BSSID value as blank and only if we run with sudo, it provides the value.


Can we get this value without sudo?

Posted on Sep 18, 2023 4:10 PM

Reply
Question marked as Top-ranking reply

Posted on Sep 19, 2023 6:01 PM

Do you always want the BSSID for the current wireless network in use? If so, you can get it without sudo using the following syntax.


ioreg -l -n AirPortDriver | perl -lne 'print $1 if $_ =~ /IO80211BSSID.*<(.*)>/;' | fold -w2 | paste -sd: -

The result will be in the format: xx:xx:xx:xx:xx

3 replies

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

How can we get the BSSID value for a wifi network without sudo

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.