nmcli:当两个接入点具有相同 SSID 时选择 BSSID

nmcli:当两个接入点具有相同 SSID 时选择 BSSID

nmcli当有两个具有相同 SSID 的接入点时,我无法连接正确的接入点。理想情况下,网络管理器应连接到信号最强的网络管理器,但它似乎总是连接到同一个信号。我什至无法通过指定 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  ▂▄▆_

请注意,网络管理器仍然连接到24:65:11:64:BA:93

其他可能相关的设置信息

  • 我正在运行 Debian 测试 bullseye/sid
  • 内核版本
    $ uname -a
    Linux binky 5.8.0-2-amd64 #1 SMP Debian 5.8.10-1 (2020-09-19) x86_64 GNU/Linux
    
  • 内容/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]
    
  • 无线适配器
    $ 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
    
  • 笔记本电脑:联想 ThinkPad X390 20Q0

答案1

看来有两个问题。

  1. bssid的参数实际上nmcli并没有达到我的预期。它仅用于选择 SSID,不会传递给wpa_supplicant.看问题#465
  2. NetworkManager 似乎没有选择信号最强的 AP。不管怎样(对我来说),它总是连接到同一个。看问题#474。我想这两个问题可能是相关的。

可以用来wpa_cli切换接入点:

$ 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  ▂▄▆_ 

如果我使用 NetworkManager 重新连接,它会恢复为24:65:11:64:BA:93.

相关内容