29

I do use iwlist wlan0 scanning and it gives me a fair amount of data, but one part is missing: It is the protocol version. By protocol I mean (a/b/g/n).

It would be very good to have these commands in a standard distro. I am using OpenWRT.

Matthias Braun
  • 7,797
  • 7
  • 45
  • 54
Justin Bibys
  • 465
  • 1
  • 5
  • 7
  • See also [this question](https://askubuntu.com/questions/191650/how-to-know-which-standard-my-wi-fi-connection-is-currently-using): "How to know which standard my Wi-Fi connection is currently using" – Matthias Braun Nov 28 '22 at 19:48

2 Answers2

43

iwconfig (and its wireless extension API) is deprecated (it's in "maintenance only mode" and "no new features will be added").

Use iw instead. This requires a moderately recent kernel (e.g. >= 3.0) with support for nl80211.

Using iw dev wlan0 scan, you can figure out the protocol used:

  • If there are Supported rates below 11 Mbps (except 6), there might be 802.11b support (even APs which allow disabling b support will announce those rates but reject b-only clients).
  • If there are Supported rates or Extended supported rates above 11 Mbps or 6 Mbps, there might be 802.11g support (even APs which are set to require_mode n will announce those rates but reject b/g clients).
  • If there are HT capabilities, there is some kind of 802.11n support. The specific high throughput features available are dependent on whether there is a secondary channel (in that case you are using a 40 MHz channel, so you have 150 Mbps per special stream instead of 72.2 Mbps), and the number of special streams supported for TX and RX.
  • If you are on the bleeding edge and you see a VHT, welcome to the 802.11ac world.
Matthias Braun
  • 7,797
  • 7
  • 45
  • 54
BatchyX
  • 3,033
  • 24
  • 13
  • 3
    Isn't there any tool in 2023 out there which directly reports the available standards (a/b/g/n/ac/ax) of the available networks? – student Jan 10 '23 at 11:16
  • 1
    @student, using wpa_supplicant's `wpa_cli status` you get info including wifi_generation (that you're currently using?) and ieee80211ac (support?), so maybe it can do it. – hkBst Jul 15 '23 at 13:16
  • @hkBst you might want to make that a full answer rather than just a comment? Seems like a good alt answer to the question and general problem – starbeamrainbowlabs Aug 21 '23 at 11:24
  • @starbeamrainbowlabs, thanks, I did as you suggested. – hkBst Aug 24 '23 at 18:32
1

Using wpa_supplicant's wpa_cli status you get the following output, which includes wifi_generation (that you're currently using?) and ieee80211ac (support?):

Selected interface 'wlan0'
bssid=77:77:11:88:aa:dd
freq=5240
ssid=XXX
id=10
mode=station
wifi_generation=5
pairwise_cipher=CCMP
group_cipher=CCMP
key_mgmt=WPA2-PSK
wpa_state=COMPLETED
ip_address=192.168.1.25
address=44:77:aa:dd:55:65
ieee80211ac=1
hkBst
  • 113
  • 3