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
nmcli connection down InternodeAC79C7
command first and thennmcli device wifi connect 20:B0:01:AC:79:C7
?24:65:11:64:BA:93
.