Hi everyone,
We try to limit the usage of WiFi-bands to only 2.4ghz. The network configuration on our devices is steered by the NetworkManager snap. Wifi-connections will be made via the NetworkManagers DBUS interface. As we do own a brand account we’re in close contact with Canonical itself, namely @bugraaydogar.
In cooperation we figured different approaches to achieve locking out 5ghz.
1. Manipulate the drive in the kernel to only enable the 2.4ghz antenna.
We do not see this as a viable option as this would mean to maintain our own kernel. Maybe it easier to achieve by unloading modules after the initial boot.
2. Connecting via BSSID instead of SSID.
This of course would be one of the easier/saver approaches. However, this would decrease UX significantly as roaming between APs would not be possible. Also, users would need to reconfigure the device as soon the change APs even if the keep the SSID/password.
3. Leveraging the wpa_supplicant
and it’s wpa_supplicant.conf
option of the freq_list
.
This is the much preferred option as this would not break current software. Also, UX would not be affected, neglecting the fact of not be able to use 5ghz.
So, @bugraaydogar suggested to change the start option of the wpa_supplicant.service file under /var/systemd/system/wpa_supplicant.conf to use the -c option were it would be possible to use a wpa_supplicant.conf file. As we tried to achieve the desired behavior for the wifi of only using listed frequencies in the given freq_list of the provided wpa_supplicant.conf, we unfortunately did not get the expected configuration. In advance we replaced the symlink of /etc/systemd/system/wpa_supplicant.conf to /lib/systemd/system/wpa_supplicant.conf and directly created a wpa_supplicant.service file. We reloaded daemon and rebooted. So it was ensured the wpa_supplicant service systemd is using was using the correct service-file.
The service file ended up looking like,
[Unit]
Description=WPA supplicant
Before=network.target
After=dbus.service
Wants=network.target
IgnoreOnIsolate=true
[Service]
Type=dbus
BusName=fi.w1.wpa_supplicant1
ExecStart=/sbin/wpa_supplicant -u -s -c /var/snap/my-snap/common/wpa_supplicant.conf -O /run/wpa_supplicant
[Install]
WantedBy=multi-user.target
Alias=dbus-fi.w1.wpa_supplicant1.service
The provided wpa_supplicant.conf had the following content,
ctrl_interface=/run/wpa_supplicant
ctrl_interface_group=0
update_config=0
freq_list=2457
We would be happy to receive suggestions how to achieve the disablement of 5ghz through the wpa_supplicant. If this can configured differently we would be happy to know about this. As long it is possible we would like to disable the 5ghz per configuration and not by filtering a scanned list or connecting through BSSID.
In appreciation of your help,
Reto