![Netplan 没有自动连接到网络](https://linux22.com/image/929385/Netplan%20%E6%B2%A1%E6%9C%89%E8%87%AA%E5%8A%A8%E8%BF%9E%E6%8E%A5%E5%88%B0%E7%BD%91%E7%BB%9C.png)
network-config
我使用描述我的 Wi-Fi 网络的文件为 Raspberry Pi 4 安装了 Ubuntu 18.04.4 。此文件已自动复制到/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 的这一部分。
答案1
你可能受到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。