我为 Raspberry Pi 4 安装了 Ubuntu 18.04.4,并带有一个network-config
描述我的 Wi-Fi 网络的文件。此文件已自动复制到/etc/netplan/50-cloud-init.yaml
.
但是,RPi 没有自动连接到网络。
当我运行sudo netplan --debug apply
它时,它确实连接了(下面的日志)。
但我想了解为什么它一开始不能自动工作,所以我不需要控制台访问来启动每个设备的网络连接。
** (generate:1719): DEBUG: 18:47:11.874: Processing input file /etc/netplan/50-cloud-init.yaml..
** (generate:1719): DEBUG: 18:47:11.875: starting new processing pass
** (generate:1719): DEBUG: 18:47:11.875: wlan0: adding wifi AP 'AccessPointA'
** (generate:1719): DEBUG: 18:47:11.875: wlan0: adding wifi AP 'AccessPointB'
** (generate:1719): DEBUG: 18:47:11.875: wlan0: setting default backend to 1
** (generate:1719): DEBUG: 18:47:11.875: Configuration is valid
** (generate:1719): DEBUG: 18:47:11.875: eth0: setting default backend to 1
** (generate:1719): DEBUG: 18:47:11.875: Configuration is valid
** (generate:1719): DEBUG: 18:47:11.876: Generating output files..
** (generate:1719): DEBUG: 18:47:11.877: NetworkManager: definition eth0 is not for us (backend 1)
** (generate:1719): DEBUG: 18:47:11.877: wlan0: Creating wpa_supplicant configuration file run/netplan/wpa-wlan0.conf
** (generate:1719): DEBUG: 18:47:11.877: Creating wpa_supplicant service enablement link /run/systemd/system/systemd-networkd.service.wants/[email protected]
** (generate:1719): DEBUG: 18:47:11.878: NetworkManager: definition wlan0 is not for us (backend 1)
DEBUG:netplan generated networkd configuration changed, restarting networkd
DEBUG:no netplan generated NM configuration exists
DEBUG:eth0 not found in {}
DEBUG:wlan0 not found in {}
DEBUG:Merged config:
network:
bonds: {}
bridges: {}
ethernets:
eth0:
dhcp4: true
optional: true
vlans: {}
wifis:
wlan0:
access-points:
AccessPointA:
password: asdf
AccessPointB:
password: asdf
dhcp4: true
optional: true
DEBUG:Skipping non-physical interface: lo
DEBUG:{}
DEBUG:netplan triggering .link rules for lo
DEBUG:netplan triggering .link rules for eth0
DEBUG:netplan triggering .link rules for wlan0
我确实看到了/var/log/cloud-init-output.log
:
network_state.py[WARNING]: Wifi configuration is only available to distros withnetplan rendering support.
此消息似乎来自cloud-init 的这一部分。
您可能会受到https://bugs.launchpad.net/cloud-init/+bug/1892851的影响。我们预计很快会在 Ubuntu 20.10 中修复此错误,并且很快会将修复程序向后移植到 Ubuntu 20.04 LTS。我们目前尚未承诺将此修复程序反向移植到 Ubuntu 18.04 LTS;获得修复的最快方法是使用 Ubuntu 20.04 LTS 而不是 18.04 LTS。