Debian – Prefer 5GHz to 2.4Ghz band for specific wifi network (SSID) without using BSSID or for all networks

debianlinuxwifi

Is there a way to prefer 5GHz band to 2.4GHz band (without disabling 2.4GHz altogether) for a specific wifi network (SSID) without setting BSSID or failing that for all networks?

I am using Mint 18.3 with Cinnamon 3.6.7's network manager.

I have a new Dell XPS 13. Kernel is 4.13.0-26-generic.

lspci | grep -i wireless
3a:00.0 Network controller: Qualcomm Atheros QCA6174 802.11ac Wireless Network Adapter (rev 32)

Background:
The routers are in an office so I cannot alter their setup. I can only do things on my laptop. Also it is the initial connection more than roaming that I am thinking of. When I connect to an SSID in the office at my desk, I would like it to prefer 5GHz to 2.4GHz (because the 5GHz signal is stronger), but right now it connects to 2.4GHz by default. Although I can set the BSSID to a specific 5GHz one which works well at my desk, this is not a good solution because if I do move around the building, I have to unset it again to allow roaming to work. I was advised by IT support to choose the prefer 5GHz option in Windows, but I am running Linux.

For Windows:
On right side of taskbar > Right-click on network icon
Choose Open Network and Sharing Center
Select Change adapter settings
Find your Wi-Fi connection (your connections will differ)
Right-click, Properties > Configure > Preferred Band to 5.2GHz
Click OK

Best Answer

You are dealing with limitations of the Wifi protocol.

Several corporate wifi vendors like Meru have non-standard technologic mitigation measures in place for dealing with that kind of limitations, because usually leaving that kind of decisions for the client is not the ideal situation, and even then they are not free of problems.

With some solutions, for instance OpenWRT or other corporate solutions, you can define threshold points/distance where the AP will force a drop of the client device from 5GHz to 2.4GHz; however a roaming client that already dropped to the 2.4GHz band, coming back again near the AP is not guaranteed to go back to 5GHz without user intervention. Meru controllers/APs have a measure/hack to try to force client devices moving back to 5GHz in those situations, and it creates a lot of problems.

As for the Dell XPS 13, it has known wifi problems because the USB C interface is right next to the wifi. Dell has not done anything about it in 3 or 4 generations of the hardware besides putting aluminum foil between the two devices in latter models, and deploying an unfortunate firmware patch for decreasing the maximum allowed potency of the wifi interface in all models.

At most on the linux side, you can monitor the wifi interface every couple of minutes in whitelisted SSIDs for when the connection is in 2.4GHz mode and force a drop of the connection when the quality is better; it is an ugly hack and I would not go down that road.

Often the solution that offers the more control for the client to select between 2.4GHz and 5GHz is having different SSIDs for the two technologies.

Saying that, at home I have both of them with the same SSID, and on the OpenWRT AP side, a threshold of 7 meters where 5GHz clients are forced to drop to the 2.4GHz band (because of walls).

To specify priorities for the initial scanning between 5GHz and 2.4GHz band, you can add to your /etc/wpa_supplicant.conf file the following directive:

scan_freq=5500 5520 ...

or

freq_list=....

However, I actually have no idea of the adqueate frequency values for your infra-structure to put in there. Ask for the advice of your IT team. I would fudge the normal values putting their active frequencies first.

Related Question