netplan:连接 wifi 失败(BCM4360)

netplan:连接 wifi 失败(BCM4360)

我安装了两个以太网接口和一个 wifi 接口。如果插入了电缆或 wifi 不可用,我希望将 wifi 作为首选网络并通过以太网连接。但是,我无法启动并运行 wifi。

我有一张带有 bcm4360 芯片组的 wifi 卡:

$ lspci -vnn | grep Network

02:00.0 Network controller [0280]: Broadcom Inc. and subsidiaries BCM4360 802.11ac Wireless Network Adapter [14e4:43a0] (rev 03)
    Subsystem: ASUSTeK Computer Inc. BCM4360 802.11ac Wireless Network Adapter [1043:85df]
03:00.0 Ethernet controller [0200]: Intel Corporation 82574L Gigabit Network Connection [8086:10d3]

我卸载并重新安装了 bcmwl-kernel-source 以及 dkms。wifi 接口显示在 iwconfig 和 ifconfig 中。dmesg 的输出为:

$ dmesg | grep wl

[  640.748759] wl: loading out-of-tree module taints kernel.
[  640.748769] wl: module license 'MIXED/Proprietary' taints kernel.
[  640.760138] wl: module verification failed: signature and/or required key missing - tainting kernel
[  640.841031] wlan0: Broadcom BCM43a0 802.11 Hybrid Wireless Controller 6.30.223.271 (r587334)
[  641.052550] wl 0000:02:00.0 wlp2s0: renamed from wlan0
[  772.491347] ERROR @wl_dev_intvar_get : 
[  772.491366] ERROR @wl_cfg80211_get_tx_power : 
[ 1797.442264] ERROR @wl_dev_intvar_get : 
[ 1797.442285] ERROR @wl_cfg80211_get_tx_power : 
[ 2269.737588] ERROR @wl_dev_intvar_get : 
[ 2269.737608] ERROR @wl_cfg80211_get_tx_power : 
[ 2967.966552] ERROR @wl_dev_intvar_get : 
[ 2967.966573] ERROR @wl_cfg80211_get_tx_power : 
[ 3418.314585] ERROR @wl_dev_intvar_get : 
[ 3418.314605] ERROR @wl_cfg80211_get_tx_power : 

netplan 50-cloud-init.yaml 文件如下所示:

network:
  version: 2
  renderer: networkd
  ethernets:
    id0:
       match:
         macaddress: 2c:76:8a:ab:d9:66
       wakeonlan: true
       dhcp4: false
       addresses:
         - 192.168.0.40/24
       #gateway4: 192.168.0.1
       nameservers:
         addresses: [8.8.8.8,8.8.4.4]
       routes:
         - to: 0.0.0.0/0
           via: 192.168.0.1
           metric: 200

    id1:
       match:
         macaddress: 68:05:ca:18:ae:00
       wakeonlan: true
       dhcp4: false
       addresses:
         - 172.16.0.40/24

  wifis:
    wlp2s0:
      access-points:
        "wifi_5g":
          password: "..."
        "wifi_2g":
          password: "..."
      dhcp4: false
      addresses:
        - 192.168.0.41/24
      nameservers:
        addresses: [8.8.8.8,8.8.4.4]
      routes:
        - to: 0.0.0.0/0
          via: 192.168.0.1
          metric: 100

运行 netplan --debug apply 将返回以下输出。

$ sudo netplan --debug apply

** (generate:14512): DEBUG: 09:28:45.108: Processing input file /etc/netplan/50-cloud-init.yaml..
** (generate:14512): DEBUG: 09:28:45.109: starting new processing pass
** (generate:14512): DEBUG: 09:28:45.110: wlp2s0: adding wifi AP 'Sunrise_5Ghz_39BD18'
** (generate:14512): DEBUG: 09:28:45.110: wlp2s0: adding wifi AP 'Sunrise_2Ghz_39BD18'
** (generate:14512): DEBUG: 09:28:45.110: We have some netdefs, pass them through a final round of validation
** (generate:14512): DEBUG: 09:28:45.110: id0: setting default backend to 1
** (generate:14512): DEBUG: 09:28:45.110: Configuration is valid
** (generate:14512): DEBUG: 09:28:45.110: wlp2s0: setting default backend to 1
** (generate:14512): DEBUG: 09:28:45.110: Configuration is valid
** (generate:14512): DEBUG: 09:28:45.110: id1: setting default backend to 1
** (generate:14512): DEBUG: 09:28:45.110: Configuration is valid
** (generate:14512): DEBUG: 09:28:45.111: Generating output files..
** (generate:14512): DEBUG: 09:28:45.111: NetworkManager: definition id0 is not for us (backend 1)
** (generate:14512): DEBUG: 09:28:45.111: NetworkManager: definition id1 is not for us (backend 1)
** (generate:14512): DEBUG: 09:28:45.111: Creating wpa_supplicant config
** (generate:14512): DEBUG: 09:28:45.111: wlp2s0: Creating wpa_supplicant configuration file run/netplan/wpa-wlp2s0.conf
** (generate:14512): DEBUG: 09:28:45.111: Creating wpa_supplicant unit /run/systemd/system/netplan-wpa-wlp2s0.service
(generate:14512): GLib-DEBUG: 09:28:45.111: posix_spawn avoided (workdir specified) (fd close requested) 
** (generate:14512): DEBUG: 09:28:45.120: Creating wpa_supplicant service enablement link /run/systemd/system/systemd-networkd.service.wants/netplan-wpa-wlp2s0.service
** (generate:14512): DEBUG: 09:28:45.120: NetworkManager: definition wlp2s0 is not for us (backend 1)
(generate:14512): GLib-DEBUG: 09:28:45.121: posix_spawn avoided (fd close requested) 
DEBUG:netplan generated networkd configuration changed, restarting networkd
Warning: The unit file, source configuration file or drop-ins of netplan-wpa-wlp2s0.service changed on disk. Run 'systemctl daemon-reload' to reload units.
DEBUG:no netplan generated NM configuration exists
DEBUG:id0 not found in {}
DEBUG:id1 not found in {'id0': {'match': {'macaddress': '2c:76:8a:ab:d9:66'}, 'wakeonlan': True, 'dhcp4': False, 'addresses': ['192.168.0.40/24'], 'nameservers': {'addresses': ['8.8.8.8', '8.8.4.4']}, 'routes': [{'to': '0.0.0.0/0', 'via': '192.168.0.1', 'metric': 200}]}}
DEBUG:wlp2s0 not found in {}
DEBUG:Merged config:
network:
  bonds: {}
  bridges: {}
  ethernets:
    id0:
      addresses:
      - 192.168.0.40/24
      dhcp4: false
      match:
        macaddress: 2c:76:8a:ab:d9:66
      nameservers:
        addresses:
        - 8.8.8.8
        - 8.8.4.4
      routes:
      - metric: 200
        to: 0.0.0.0/0
        via: 192.168.0.1
      wakeonlan: true
    id1:
      addresses:
      - 172.16.0.40/24
      dhcp4: false
      match:
        macaddress: 68:05:ca:18:ae:00
      wakeonlan: true
  vlans: {}
  wifis:
    wlp2s0:
      access-points:
        wifi_2g:
          password: ...
        wifi_5g:
          password: ...
      addresses:
      - 192.168.0.41/24
      dhcp4: false
      nameservers:
        addresses:
        - 8.8.8.8
        - 8.8.4.4
      routes:
      - metric: 100
        to: 192.168.0.0/0
        via: 192.168.0.1

DEBUG:Skipping non-physical interface: lo
DEBUG:Skipping non-physical interface: enp4s0
DEBUG:Skipping non-physical interface: enp3s0
DEBUG:Skipping non-physical interface: br-f600156048d1
DEBUG:Skipping non-physical interface: docker0
DEBUG:Skipping non-physical interface: br-ad1698f5d014
DEBUG:Skipping non-physical interface: veth82919f1
DEBUG:Skipping non-physical interface: veth1475608
DEBUG:Skipping non-physical interface: veth9aff82f
DEBUG:Skipping non-physical interface: veth2509577
DEBUG:device wlp2s0 operstate is dormant, not changing
DEBUG:{}
DEBUG:netplan triggering .link rules for lo
DEBUG:netplan triggering .link rules for enp4s0
DEBUG:netplan triggering .link rules for enp3s0
DEBUG:netplan triggering .link rules for br-f600156048d1
DEBUG:netplan triggering .link rules for docker0
DEBUG:netplan triggering .link rules for br-ad1698f5d014
DEBUG:netplan triggering .link rules for veth82919f1
DEBUG:netplan triggering .link rules for veth1475608
DEBUG:netplan triggering .link rules for veth9aff82f
DEBUG:netplan triggering .link rules for veth2509577
DEBUG:netplan triggering .link rules for wlp2s0
Warning: The unit file, source configuration file or drop-ins of netplan-wpa-wlp2s0.service changed on disk. Run 'systemctl daemon-reload' to reload units.

我注意到,WiFi适配器设置为“休眠”,所以我尝试改变其状态

$ sudo ip link set wlp2s0 up

并重新运行 netplan apply 并检查系统日志:

journalctl -b

Mai 03 09:58:19 linuxhost sudo[14786]:   adrian : TTY=pts/1 ; PWD=/etc/netplan ; USER=root ; COMMAND=/sbin/ip link set wlp2s0 up
Mai 03 09:58:19 linuxhost sudo[14786]: pam_unix(sudo:session): session opened for user root by adrian(uid=0)
Mai 03 09:58:19 linuxhost sudo[14786]: pam_unix(sudo:session): session closed for user root
Mai 03 09:59:11 linuxhost sudo[14792]:   adrian : TTY=pts/1 ; PWD=/etc/netplan ; USER=root ; COMMAND=/usr/sbin/netplan --debug apply
Mai 03 09:59:11 linuxhost sudo[14792]: pam_unix(sudo:session): session opened for user root by adrian(uid=0)
Mai 03 09:59:11 linuxhost systemd[1]: Stopping Network Service...
Mai 03 09:59:11 linuxhost systemd[1]: Stopping WPA supplicant for netplan wlp2s0...
Mai 03 09:59:11 linuxhost systemd[1]: systemd-networkd.service: Succeeded.
Mai 03 09:59:11 linuxhost systemd[1]: Stopped Network Service.
Mai 03 09:59:11 linuxhost wpa_supplicant[14732]: nl80211: deinit ifname=wlp2s0 disabled_11b_rates=0
Mai 03 09:59:11 linuxhost systemd[1]: Starting Network Service...
Mai 03 09:59:11 linuxhost wpa_supplicant[14732]: wlp2s0: CTRL-EVENT-TERMINATING
Mai 03 09:59:12 linuxhost systemd[1]: netplan-wpa-wlp2s0.service: Succeeded.
Mai 03 09:59:12 linuxhost systemd[1]: Started WPA supplicant for netplan wlp2s0.
Mai 03 09:59:12 linuxhost wpa_supplicant[14823]: Successfully initialized wpa_supplicant
Mai 03 09:59:12 linuxhost sudo[14792]: pam_unix(sudo:session): session closed for user root
Mai 03 09:59:12 linuxhost wpa_supplicant[14823]: wlp2s0: CTRL-EVENT-SCAN-FAILED ret=-16 retry=1
Mai 03 09:59:13 linuxhost wpa_supplicant[14823]: wlp2s0: CTRL-EVENT-SCAN-FAILED ret=-16 retry=1
Mai 03 09:59:13 linuxhost systemd-networkd[14806]: wlp2s0: Gained IPv6LL
Mai 03 09:59:13 linuxhost systemd-networkd[14806]: veth2509577: Gained IPv6LL
Mai 03 09:59:13 linuxhost systemd-networkd[14806]: veth9aff82f: Gained IPv6LL
Mai 03 09:59:13 linuxhost systemd-networkd[14806]: veth1475608: Gained IPv6LL
Mai 03 09:59:13 linuxhost systemd-networkd[14806]: veth82919f1: Gained IPv6LL
Mai 03 09:59:13 linuxhost systemd-networkd[14806]: docker0: Gained IPv6LL
Mai 03 09:59:13 linuxhost systemd-networkd[14806]: br-f600156048d1: Gained IPv6LL
Mai 03 09:59:13 linuxhost systemd-networkd[14806]: enp3s0: Gained IPv6LL
Mai 03 09:59:13 linuxhost systemd-networkd[14806]: enp4s0: Gained IPv6LL
Mai 03 09:59:13 linuxhost systemd-networkd[14806]: Enumeration completed
Mai 03 09:59:13 linuxhost systemd[1]: Started Network Service.
Mai 03 09:59:13 linuxhost systemd-networkd[14806]: wlp2s0: Gained carrier
Mai 03 09:59:13 linuxhost systemd-networkd[14806]: wlp2s0: Lost carrier
Mai 03 09:59:13 linuxhost systemd-networkd[14806]: wlp2s0: IPv6 successfully enabled
Mai 03 09:59:13 linuxhost systemd-networkd[14806]: enp3s0: IPv6 successfully enabled
Mai 03 09:59:13 linuxhost systemd-networkd[14806]: enp4s0: IPv6 successfully enabled

我被这个问题困扰了,不知道我错过了什么。

相关内容