7

I'm having trouble getting nmcli to connect the right access point when there are two with the same SSID. Ideally Network-Manager should connect to the one with the strongest signal, but it always seems to connect to the same one. I can't even force it to connect to the one I want by specifying the BSSID:

$ nmcli -f in-use,ssid,bssid,signal,rate,bars  dev wifi
IN-USE  SSID                       BSSID              SIGNAL  RATE        BARS 
        InternodeAC79C7            20:B0:01:AC:79:C7  92      130 Mbit/s  ▂▄▆█ 
        InternodeAC79C7-5G         22:B0:01:AC:79:CF  92      405 Mbit/s  ▂▄▆█ 
*       InternodeAC79C7            24:65:11:64:BA:93  72      270 Mbit/s  ▂▄▆_ 
$ nmcli device wifi connect 20:B0:01:AC:79:C7
Device 'wlp0s20f3' successfully activated with 'f1c36a2e-8fb0-4f88-95a7-40b9ddc32056'.
$ nmcli -f in-use,ssid,bssid,signal,rate,bars  dev wifi
IN-USE  SSID                       BSSID              SIGNAL  RATE        BARS 
        InternodeAC79C7            20:B0:01:AC:79:C7  92      130 Mbit/s  ▂▄▆█ 
        InternodeAC79C7-5G         22:B0:01:AC:79:CF  89      405 Mbit/s  ▂▄▆█ 
*       InternodeAC79C7            24:65:11:64:BA:93  62      270 Mbit/s  ▂▄▆_

Notice that Network-Manager is still connected to 24:65:11:64:BA:93.

Other possibly relevant set up info

  • I'm running Debian Testing bullseye/sid
  • Kernel version
    $ uname -a
    Linux binky 5.8.0-2-amd64 #1 SMP Debian 5.8.10-1 (2020-09-19) x86_64 GNU/Linux
    
  • Contents of /etc/NetworkManager/system-connections/InternodeAC79C7.nmconnection
    [connection]
    id=InternodeAC79C7
    uuid=f1c36a2e-8fb0-4f88-95a7-40b9ddc32056
    type=wifi
    interface-name=wlp0s20f3
    permissions=user:dcpurton:;
    timestamp=1601538860
    
    [wifi]
    mac-address-blacklist=
    mode=infrastructure
    seen-bssids=20:B0:01:AC:79:C7;24:65:11:64:BA:93;
    ssid=InternodeAC79C7
    
    [wifi-security]
    key-mgmt=wpa-psk
    psk=*****
    
    [ipv4]
    dns-search=
    method=auto
    
    [ipv6]
    addr-gen-mode=stable-privacy
    dns-search=
    ip6-privacy=0
    method=auto
    
    [proxy]
    
  • Wireless adaptor
    $ sudo lspci -v
    00:14.3 Network controller: Intel Corporation Cannon Point-LP CNVi [Wireless-AC] (rev 30)
        Subsystem: Intel Corporation Cannon Point-LP CNVi [Wireless-AC]
        Flags: bus master, fast devsel, latency 0, IRQ 16, IOMMU group 6
        Memory at c9738000 (64-bit, non-prefetchable) [size=16K]
        Capabilities: [c8] Power Management version 3
        Capabilities: [d0] MSI: Enable- Count=1/1 Maskable- 64bit+
        Capabilities: [40] Express Root Complex Integrated Endpoint, MSI 00
        Capabilities: [80] MSI-X: Enable+ Count=16 Masked-
        Capabilities: [100] Null
        Capabilities: [14c] Latency Tolerance Reporting
        Capabilities: [164] Vendor Specific Information: ID=0010 Rev=0 Len=014 <?>
        Kernel driver in use: iwlwifi
        Kernel modules: iwlwifi
    
  • Laptop: Lenovo ThinkPad X390 20Q0
2
  • Have you tried issuing an nmcli connection down InternodeAC79C7 command first and then nmcli device wifi connect 20:B0:01:AC:79:C7 ?
    – Krackout
    Oct 1, 2020 at 7:53
  • @Krackout, same result. It still connects to 24:65:11:64:BA:93. Oct 1, 2020 at 7:55

1 Answer 1

6

It seems there are two issues.

  1. The bssid parameter of nmcli does not actually do what I expect. It's only used to select the SSID, and isn't passed to wpa_supplicant. See issue #465
  2. NetworkManager doesn't seem to pick the AP with the strongest signal. It always connects to the same one no matter what (for me). See issue #474. I guess possibly these two issues are related.

It is possible to use wpa_cli to switch access points:

$ sudo wpa_cli list_networks
Selected interface 'wlp0s20f3'
network id / ssid / bssid / flags
0   InternodeAC79C7 any [CURRENT]
$ sudo wpa_cli bssid 0 20:B0:01:AC:79:C7
Selected interface 'wlp0s20f3'
OK
$ sudo wpa_cli reassociate
Selected interface 'wlp0s20f3'
OK
$ sudo wpa_cli list_networks
Selected interface 'wlp0s20f3'
network id / ssid / bssid / flags
0   InternodeAC79C7 20:b0:01:ac:79:c7   [CURRENT]
$ nmcli -f in-use,ssid,bssid,signal,rate,bars  dev wifi
IN-USE  SSID                       BSSID              SIGNAL  RATE        BARS 
*       InternodeAC79C7            20:B0:01:AC:79:C7  92      130 Mbit/s  ▂▄▆█ 
        InternodeAC79C7-5G         22:B0:01:AC:79:CF  92      405 Mbit/s  ▂▄▆█ 
        InternodeAC79C7            24:65:11:64:BA:93  72      270 Mbit/s  ▂▄▆_ 

If I use NetworkManager to reconnect, it reverts back to 24:65:11:64:BA:93.

0

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.