[Networkmanager] nmcli: Specify which channel I want to connect?
Thomas Haller
thaller at redhat.com
Thu Aug 17 11:37:28 UTC 2023
On Thu, 2023-08-17 at 10:24 +0100, Ottavio Caruso wrote:
> Hi, I want to connect to a certain hotspot, but this is a corporate
> entity with different access points all around the building, each of
> them at different channels (usually 1 or 6 for the 2.4 Ghz band and
> 44
> or 60 for the 5ghz band).
>
> I can either edit the connection on Network Manager but then I would
> have to edit it again next time, or I can do:
>
> $ nmcli connection up <SSID>
>
> Is there a way to pass the ap channel straight over to nmcli?
>
> Thanks.
Hi,
no, there isn't.
The profile has settings like wifi.band, wifi.channel, wifi.bssid. If
those are set, then supplicant is told to only connect to those APs.
But those are per-profile settings, and a profile is persisted
configuration, not only for the current activation.
Wpa_supplicant decides which AP to choose, and when to roam (setting
wifi.bssid of course disables roaming).
Even if there were a hypothetical command
nmcli connection up $WIFI_PROFILE --bssid $AP
then supplicant will make the decision to roam at an time later, and it
will do so based on it's best guess when to do that. Initially telling
supplicant which AP to connect to, seems not useful, if the profile
explicitly allows for roaming (as it has wifi.bssid not set).
Maybe there could be an activation parameter, that does force
"wifi.bssid" -- only for the duration of the current activation (and
without modifying the profile). That might be a nice feature, but it
wouldn't work with autoconnect (so maybe not that useful). Also, if you
move away from the AP, you suddenly wouldn't roam anymore. That seems
quite undesirable.
If wpa_supplicant chooses a non-optimal AP, then maybe the algorithm
for roaming has a problem and should be improved. But the solution
would not be that the user manually selects the AP during connect time.
Thomas
More information about the Networkmanager
mailing list