Netplan does not connect to Wireless after `sudo netplan apply` until reboot
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
netplan.io (Ubuntu) |
Fix Released
|
High
|
Lukas Märdian | ||
Eoan |
Fix Released
|
Undecided
|
Lukas Märdian | ||
Focal |
Fix Released
|
High
|
Lukas Märdian |
Bug Description
Summary
=======
Issue observed using 20200422 images focal-preinstal
- Rapsberry Pi 4 4GB
- Rapsberry Pi 3B
When setting up Wireless network via netplan config on a Raspberry Pi 4 4GB with Ubuntu Server 20.04, the settings are not taken into account until the device is rebooted, because the service created (netplan-
A workaround is to manually restart the service after applying netplan configuration
$ sudo netplan apply
$ sudo systemctl restart netplan-
This should be done automatically when a new netplan configuration is applied.
SRU acceptance criteria
=======
The netplan package is generally covered by an SRU exception, so general testing should suffice. That being said, the fix can be verified explicitly by making sure that WiFi configuration still works: using the -proposed packages on a WiFi-enabled device, craft a netplan yaml config enabling wifi and apply the config with `netplan apply`. Wireless should now be working correctly without any other manual steps.
Steps to reproduce
==================
1. Install Ubuntu Server 20.04 image (focal-
2. Connect a screen and a USB keyboard, or connect to the device via serial console (UART).
3. By default, the device is not connected to the network yet:
$ ip a
1: lo: <LOOPBACK,
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <NO-CARRIER,
link/ether dc:a6:32:57:b9:ba brd ff:ff:ff:ff:ff:ff
3: wlan0: <BROADCAST,
link/ether dc:a6:32:57:b9:bb brd ff:ff:ff:ff:ff:ff
$ networkctl
IDX LINK TYPE OPERATIONAL SETUP
1 lo loopback carrier unmanaged
2 eth0 ether no-carrier configuring
3 wlan0 wlan off unmanaged
3 links listed.
4. Create a netplan config file to match your WiFi router config and copy it to /etc/netplan/:
$ cat lab.yaml
network:
version: 2
wifis:
wlan0:
access-
password: myp455w0rd
dhcp4: yes
$ sudo cp lab.yaml /etc/netplan/
5. Apply the new configuration:
$ sudo netplan apply
In journalctl:
Apr 23 03:57:38 ubuntu systemd[1]: systemd-
Apr 23 03:57:38 ubuntu systemd[1]: Stopped Wait for Network to be Configured.
Apr 23 03:57:38 ubuntu systemd[1]: Stopping Network Service...
Apr 23 03:57:38 ubuntu systemd[1]: systemd-
Apr 23 03:57:38 ubuntu systemd[1]: Stopped Network Service.
Apr 23 03:57:39 ubuntu systemd[1]: Starting Network Service...
Apr 23 03:57:39 ubuntu sudo[1674]: pam_unix(
Apr 23 03:57:39 ubuntu systemd-
Apr 23 03:57:39 ubuntu systemd[1]: Star[ 223.067294] brcmfmac: brcmf_cfg80211_
ted Network Service.
Apr 23 03:57:39 ubuntu systemd-
Apr 23 03:57:39 ubuntu systemd-
Apr 23 03:57:39 ubuntu kernel: brcmfmac: brcmf_cfg80211_
Apr 23 03:57:39 ubuntu systemd-
$ networkctl
IDX LINK TYPE OPERATIONAL SETUP
1 lo loopback carrier unmanaged
2 eth0 ether no-carrier configuring
3 wlan0 wlan no-carrier configuring
3 links listed.
$ ip a
1: lo: <LOOPBACK,
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <NO-CARRIER,
link/ether dc:a6:32:57:b9:ba brd ff:ff:ff:ff:ff:ff
3: wlan0: <NO-CARRIER,
link/ether dc:a6:32:57:b9:bb brd ff:ff:ff:ff:ff:ff
Even if I wait 5 minutes, nothing moves. networkctl tells me wlan0 is "configuring", but nothing happens in the journal.
Trying to restart systemd-networkd doesn't help:
$ sudo systemctl status systemd-networkd
● systemd-
Loaded: loaded (/lib/systemd/
Active: active (running) since Thu 2020-04-23 03:57:39 UTC; 1min 18s ago
TriggeredBy: ● systemd-
Docs: man:systemd-
Main PID: 1687 (systemd-network)
Status: "Processing requests..."
Tasks: 1 (limit: 4434)
CGroup: /system.
└─1687 /lib/systemd/
Apr 23 03:57:39 ubuntu systemd[1]: Starting Network Service...
Apr 23 03:57:39 ubuntu systemd-
Apr 23 03:57:39 ubuntu systemd[1]: Started Network Service.
Apr 23 03:57:39 ubuntu systemd-
Apr 23 03:57:39 ubuntu systemd-
Apr 23 03:57:39 ubuntu systemd-
$ sudo systemctl restart systemd-networkd
Apr 23 03:59:40 ubuntu systemd[1]: Stopping Network Service...
Apr 23 03:59:40 ubuntu systemd[1]: systemd-
Apr 23 03:59:40 ubuntu systemd[1]: Stopped Network Service.
Apr 23 03:59:40 ubuntu systemd[1]: Starting Network Service...
Apr 23 03:59:40 ubuntu systemd-
Apr 23 03:59:40 ubuntu systemd[1]: Started Network Service.
Apr 23 03:59:40 ubuntu sudo[1719]: pam_unix(
Apr 23 03:59:40 ubuntu systemd-
Apr 23 03:59:40 ubuntu systemd-
$ ip a
1: lo: <LOOPBACK,
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <NO-CARRIER,
link/ether dc:a6:32:57:b9:ba brd ff:ff:ff:ff:ff:ff
3: wlan0: <NO-CARRIER,
link/ether dc:a6:32:57:b9:bb brd ff:ff:ff:ff:ff:ff
$ networkctl
IDX LINK TYPE OPERATIONAL SETUP
1 lo loopback carrier unmanaged
2 eth0 ether no-carrier configuring
3 wlan0 wlan no-carrier configuring
3 links listed.
I then found there is a `netplan-wpa-wlan0` systemd service that is "inactive". Restarting it, the connection process happens, the device gets an IP from the DHCP server (my WiFi router), and I can ping the gateway and the outside:
$ sudo systemctl status netplan-
● netplan-
Loaded: loaded (/run/systemd/
Active: inactive (dead)
$ sudo systemctl restart netplan-
Apr 23 04:01:25 ubuntu wpa_supplicant[
Apr 23 04:01:28 ubuntu wpa_supplicant[
Apr 23 04:01:30 ubuntu wpa_supplicant[
Apr 23 04:01:33 ubuntu wpa_supplicant[
Apr 23 04:01:35 ubuntu systemd-udevd[760]: Network interface NamePolicy= disabled on kernel command line, ignoring.
Apr 23 04:01:35 ubuntu wpa_supplicant[
Apr 23 04:01:35 ubuntu wpa_supplicant[
Apr 23 04:01:35 ubuntu wpa_supplicant[
Apr 23 04:01:35 ubuntu kernel: IPv6: ADDRCONF(
Apr 23 04:01:35 ubuntu systemd-
Apr 23 04:01:35 ubuntu systemd-
Apr 23 04:01:36 ubuntu systemd-
Apr 23 04:01:36 ubuntu dbus-daemon[1297]: [system] Activating via systemd: service name='org.
Apr 23 04:01:36 ubuntu systemd-
Apr 23 04:01:36 ubuntu systemd[1]: Starting Hostname Service...
Apr 23 04:02:02 ubuntu systemd-
Apr 23 04:02:02 ubuntu dbus-daemon[1297]: [system] Successfully activated service 'org.freedeskto
Apr 23 04:02:02 ubuntu systemd[1]: Started Hostname Service.
Apr 23 04:02:03 ubuntu systemd-
$ ip a
1: lo: <LOOPBACK,
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <NO-CARRIER,
link/ether dc:a6:32:57:b9:ba brd ff:ff:ff:ff:ff:ff
3: wlan0: <BROADCAST,
link/ether dc:a6:32:57:b9:bb brd ff:ff:ff:ff:ff:ff
inet 192.168.1.228/24 brd 192.168.1.255 scope global dynamic wlan0
valid_lft 86344sec preferred_lft 86344sec
inet6 fe80::dea6:
valid_lft forever preferred_lft forever
$ networkctl
IDX LINK TYPE OPERATIONAL SETUP
1 lo loopback carrier unmanaged
2 eth0 ether no-carrier configuring
3 wlan0 wlan routable configured
ProblemType: Bug
DistroRelease: Ubuntu 20.04
Package: netplan.io 0.99-0ubuntu1
ProcVersionSign
Uname: Linux 5.4.0-1008-raspi aarch64
ApportVersion: 2.20.11-0ubuntu27
Architecture: arm64
CasperMD5CheckR
Date: Thu Apr 23 04:14:27 2020
SourcePackage: netplan.io
UpgradeStatus: No upgrade log present (probably fresh install)
description: | updated |
Changed in netplan.io (Ubuntu): | |
status: | In Progress → Triaged |
importance: | Undecided → High |
Changed in netplan.io (Ubuntu): | |
status: | Triaged → In Progress |
description: | updated |
Changed in netplan.io (Ubuntu Eoan): | |
assignee: | nobody → Lukas Märdian (slyon) |
tags: |
added: verification-done removed: verification-needed |
Indeed there seems to be a problem with 'netplan apply'. It tries to activate/start a systemd service unit called "<email address hidden>", while the actual name of the service unit is "netplan- wpa-wlan0. service" .
Could you try to verify if the following patch fixes your problem? /paste. ubuntu. com/p/qgc6FPP4G f/
https:/