13

On Linux (specificially Ubuntu) what's the easiest way to determine what types of Wifi protocols your hardware and driver support?

I have a router running DD-WRT that supports broadcasting in both a 2.4Ghz and 5Ghz wifi with network modes of either Mixed, BG-mixed, B-only, G-only, NG-only, N-only.

I have numerous wireless devices running Linux, from Android phones to networks to Macbooks, and I'm finding it difficult to set a configuration that supports everything. Setting it to broadcast both 2.4 and 5 in mixed mode seems to cover all devices, but also puts the most load on my router. So I tried only enabling 2.4 in mixed both, and everything could connect, but overall network performance was slow because there are tons of 2.4 networks in my area, causing lots of congestion.

When I tried enabling only 5Ghz in mixed mode, I found most of my older devices could not longer see the network, even though some of them have connected to 5Ghz networks at other locations. e.g. I have a Macbook that can connect to some 5Ghz networks, and its lspci shows:

03:00.0 Network controller: Broadcom Corporation BCM4322 802.11a/b/g/n Wireless LAN Controller (rev 01)

but it's completely unable to detect my router's 5GHz network.

On a netbook, running iwconfig wlan0 shows:

IEEE 802.11abg

implying it should be able to access my router's 5 GHz mixed a/n network, but running nmcli dev wifi list only shows 2.4 GHz networks. Why is this?

Is there some command I can run from the command line that will list all the frequencies and network modes supported by the current wifi driver, so I can find the optimal setting for my wireless router?

16

Supported capability on your clients

iw phy on GNU/Linux should list what you want (and a lot more) about your wireless interfaces, although it's a bit confusing at first sight.

What you're looking for is if your network card works in dual-band mode. You'll then see Band 1: and Band 2: section, first one usually for 2.4Ghz and second one for 5Ghz. Under each bands you'll see Bitrates (non-HT):, listing the supported bitrates for 802.11bg in 2.4Ghz or 802.11a in 5Ghz.

You're also looking for HT20/HT40 under Capabilities: for each band. It means 802.11n is supported. HT20 is for 20Mhz width channels, HT40 for 40Mhz width.

If you want to know more about 802.11n capabilities, for example number of spatial streams (for MIMO) and supported rates, look at the HT TX/RX MCS rate indexes supported: line. 0-15 means MCS Indexes from 0 to 15 are supported, ie. it can works in MIMO 2x2 with data rate up to 130 Mb/s in HT20 or 270 Mb/s in HT40. Additionally, if RX HT20 SGI and/or RX HT40 SGI is listed under Capabilities:, it means Short GI (400 ns) is supported so max data rate is 144 Mb/s for HT20 and 300 Mb/s for HT40. See here for a list of MCS Indexes: https://wireless.wiki.kernel.org/en/developers/documentation/ieee80211/802.11n

Frequencies: list supported frequencies and associated channels. Some may be disabled because either your hardware or software doesn't support it, or because your regulatory domain doesn't allow it. If your WiFi access point broadcast signal on a disabled channel you will not be able to connect. You can see which channels are allowed in your area here: https://en.wikipedia.org/wiki/List_of_WLAN_channels

Additionally you may see VHT Capabilities and other VHT related info. It's about 802.11ac, but your access point does not support it (neither the chipset you indicated), so you can ignore it.

Access point configuration

I would really recommend you to keep your WiFi access point configured to broadcast on both 2.4Ghz and 5Ghz. Nowadays, 2.4Ghz is very crowded and is more subject to interferences, when 5Ghz has much less devices using it. Problem is that 5 Ghz is generally supported only on recent or high-end devices whereas 2.4 Ghz is the default band used on WiFi devices. Also 5Ghz signal range is less than 2.4Ghz and more subject to degradation due to obstacles.

Using both bands enables you to have wireless on the most devices (either because they don't support 5Ghz or because the signal is degraded, so they fall back on 2.4Ghz) while having better performances in high-end/recent devices (because they're using the 5Ghz band).

Finally you shouldn't worry about B, G and N on your access point, you should select the mode which provides the three standads (mixed) so that older 802.11g (802.11b devices are very rare nowadays) devices can still connect and newer 802.11n work at full speed. Also only 802.11a and 802.11n work in the 5Ghz band. (there's 802.11ac too but you're not working with it)

Maybe you'll also see a channel setting. Usually leaving it to the default will do the job, your access point should be clever enough to select the best. (and it prevents you from selecting a channel overlapping on others creating even more interferencies)

Link between the two

iw dev on GNU/Linux will show you how your client and your access point are connected. Ideally it will be in a channel on the 5Ghz band (and allowed in your area) with 40Mhz width.

  • 1
    "iw dev on GNU/Linux will show you how your client and your access point are connected" - it's actually iw dev wlan0 link. – pfalcon Jan 2 '17 at 22:29
  • For 802.11ac the keyword you are looking for is VHT, for Very High Throughput. My 802.11n cards don't have this term. My 802.11ac card lists VHT Capabilities (0x038071b0): and short GI (80 MHz) – Huckle Jul 26 '17 at 5:37
  • blech that command output is so verbose. iw phy | grep -i Band -A 20 no chill – g33kz0r Jul 30 '17 at 7:33
1

@piernov's answer is good, but a simpler but possibly less accurate method I found was to run:

lspci | egrep -i --color 'wifi|wlan|wireless'

which will show something like:

03:00.0 Network controller: Broadcom Corporation BCM4322 802.11a/b/g/n Wireless LAN Controller (rev 01)

This shows what the hardware theoretically supports. You can then interpret the "802.11[abcgn/]+", where b and g are 2.4 GHz only, a is 5 GHz only, and ac and n are both 2.4 and 5 GHz.

To see what the driver actually supports, run:

iwconfig wlan0

which should show something like:

wlan0     IEEE 802.11bg  ESSID:off/any
  • Using lspci can give you some information about your chipset but it's not very reliable. Same chipsets can give different functionnalities and sometimes they are not included in their name, for example this one: Intel Corporation Wireless 7260 (rev bb) can provide 801.11bgn, optionally with 802.11a and 802.11ac. Some 802.11n chipsets only support it on the 2.4Ghz band, not the 5Ghz. Also iwconfig doesn't give you much information about supported frequencies. Sometimes problem might come from a misconfiguration of the regulatory domain in the 5Ghz band (disabled freqs). – piernov Jul 26 '15 at 22:42
  • FWIW my lspci doesn't include those terms. Instead, it's 03:00.0 Network controller: Intel Corporation Centrino Advanced-N 6230 [Rainbow Peak] (rev 34). Probably more useful to grep for Network controller. – Sparhawk May 16 '16 at 3:29
  • Mine's a Realtek and lspci doesn't show that information either. I believe mine's 802.11b/g/n (still trying to figure out for sure). For me, the command outputs 06:00.0 Network controller: Realtek Semiconductor Co., Ltd. RTL8192CE PCIe Wireless Network Adapter (rev 01) – biggles5107 May 20 '18 at 21:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.