11

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

2
  • We need more info : what kind of wifi adapter are you using ? How do you connect to these access points (NetworkManager, command line tool...) ? Which version of Linux Mint are you running, using which kernel ... ?
    – user264413
    Commented Jan 23, 2018 at 9:27
  • Hi @ThomasGros I have added the information. Let me know if there is anything else you need.
    – mcarans
    Commented Jan 23, 2018 at 9:41

2 Answers 2

6

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.

12
  • I forgot to say that the routers are in an office so I cannot alter their setup. I can only do things on the Linux side. Also it is the initial connection rather than roaming that I am thinking of. When I connect to an SSID 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). Setting the BSSID doesn't work well because if I do move around the building, I have to unset it again. I will add this into the question.
    – mcarans
    Commented Jan 23, 2018 at 12:20
  • It is not normal selecting 2.4GHz by default unless you are far away from the 5Ghz APs. What you are saying does not change my answer. I however find it one you getting by default in the 2.4GHz if both bands are equally strong. Commented Jan 23, 2018 at 12:22
  • 1
    It's strange though because the signal is clearly weaker when it actually connects to the 2.4GHz one and I used a tool to check the strengths of the different BSSIDs which also showed that one BSSID is stronger. I was told by IT support here to use the setting prefer 5GHz in Windows, but I am running Linux.
    – mcarans
    Commented Jan 23, 2018 at 12:25
  • Your edit to add info on scan_freq in /etc/wpa_supplicant.conf looks promising. Is that used by Cinnamon's network manager or will I have to use the CLI? Is there a tool I can run to get those frequencies?
    – mcarans
    Commented Jan 23, 2018 at 16:10
  • 1
    @Piskvor Indeed, good call. In my answer, I was more worried of prioritising the frequencies in use by the OP's local infra-structure, edited slightly the answer for it to be clearer. Commented May 29, 2019 at 10:33
2

Although not for specific SSID, but (given the lack of answers here) you can steer iwd backend to prefer 5Ghz over 2.4Ghz in general.

iwd is an alternative (to the default wpa_supplicant) WiFi backend. NetworkManager integration with iwd is still experimental, so there may be some gaps in functionality, but for basic WiFi usage it seems to work fine.

iwd already prefers 5Ghz over 2.4Ghz, but you can enforce that further. There's BandModifier5Ghz option, a floating-point value that increases priority of 5Ghz points over 2.4Ghz and 6Ghz. Default is 1.0. In the example below I set it to 9.0, which in my experiments seems enough to stop it from falling back to 2.4Ghz.¹

Example: create file /etc/iwd/main.conf with:

[Rank]
BandModifier5Ghz=9.0

…then restart iwd. NM doesn't seem to restart it when it's restarted itself (as I mentioned the integration is still WIP), so the simplest way might be to just reboot.


1: The exact upper limits are undocumented. Looking at the source, it does some complicated calculation by multiplying the BandModifier5Ghz with other factors such as network utilization. However, in the same function it caps the value to USHRT_MAX, so presumably if you want to go as high as possible, you can set BandModifier5Ghz=65535 (I tested that it works).

You must log in to answer this question.

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