2

How can I find which 802.11 protocol (e.g. 802.11ac) my network card is using from the command line?

This provides several ways of doing this using GUI utilities, but I want to be able to do it programmatically.

I have tried airport, netstat, and many other things but haven't found an option that would give me this information.

6
  • 1
    The closest you can get is system_profiler SPAirPortDataType | grep -i "IO80211\|Firmware" That will give you the 802.11 "Family" and the Hardware firmware. That family seems to be an Apple convention (12 = ac). As for the firmware, you could always look up the specification for BCM43xx. As for the airport utility, even in logger mode, it only ouputs supported PHY Mode in Hex. The value I got was "31" (decimal) which doesn't translate to anything, but assume it means 802.11ac because that's what my iMac supports. It's their software that seems to translate these values
    – Allan
    Commented May 8, 2020 at 22:59
  • @Allan MCS = Modulation and Coding Index (for 802.11n, ac and future), see mcsindex.com . 12 ( = 12/16) means you can use 3/4 of the physical radio bandwidth, which means "very good".
    – dan
    Commented May 9, 2020 at 7:40
  • @Allan "31" is a decimal bit pattern and means here: a,b,g,n,ac, which means "a lot".
    – dan
    Commented May 9, 2020 at 8:15
  • @dan So, how does one read that decimal code? The Family identifier is static - where on the mcsindex does “Family” correlate to bandwidth?
    – Allan
    Commented May 9, 2020 at 15:45
  • @Allan, MCS and supported physical mode are independant. For example you can get an MCS index of 12 (which is a quality of your radio environnment) when you use 801.11n or 802.11ac.
    – dan
    Commented May 9, 2020 at 18:24

1 Answer 1

1

One correct method seems to be:

system_profiler SPAirPortDataType | awk '/PHY Mode:/ { print $3 ; exit }'

The awk script (between ' ) means:

on first expression 'PHY Mode:', print the third field and exit the script.

1
  • Thanks to @Allan who pointed me on the right tool to start.
    – dan
    Commented May 9, 2020 at 8:17

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .