[Bug 1874377] Re: Netplan does not connect to Wireless after `sudo netplan apply` until reboot

Łukasz Zemczak 1874377 at bugs.launchpad.net
Thu Apr 23 16:47:43 UTC 2020


Fixed in 0.99-0ubuntu2. There will be a follow-up fix for other edge
cases and upgrades, but for now it should all work.

** Changed in: netplan.io (Ubuntu Focal)
       Status: In Progress => Fix Released

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to netplan.io in Ubuntu.
Matching subscriptions: foundations-bugs
https://bugs.launchpad.net/bugs/1874377

Title:
  Netplan does not connect to Wireless after `sudo netplan apply` until
  reboot

Status in netplan.io package in Ubuntu:
  Fix Released
Status in netplan.io source package in Focal:
  Fix Released

Bug description:
  Summary
  =======

  Issue observed using 20200422 images focal-preinstalled-server-arm64+raspi.img.xz and focal-preinstalled-server-armhf+raspi.img.xz on:
  - 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-wpa-wlan0.service) is in a "inactive (dead)" state.

  A workaround is to manually restart the service after applying netplan
  configuration

  $ sudo netplan apply
  $ sudo systemctl restart netplan-wpa-wlan0.service

  This should be done automatically when a new netplan configuration is
  applied.

  Steps to reproduce
  ==================

  1. Install Ubuntu Server 20.04 image (focal-preinstalled-server-arm64+raspi.img.xz) on a Raspberry Pi 4 4GB (I haven't tested with Ubuntu Server on other devices).
  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,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
      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,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN group default qlen 1000
      link/ether dc:a6:32:57:b9:ba brd ff:ff:ff:ff:ff:ff
  3: wlan0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
      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-points:
          ubuntu-cert-wpa:
            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-networkd-wait-online.service: Succeeded.
  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-networkd.service: Succeeded.
  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(sudo:session): session closed for user root
  Apr 23 03:57:39 ubuntu systemd-networkd[1687]: Enumeration completed
  Apr 23 03:57:39 ubuntu systemd[1]: Star[  223.067294] brcmfmac: brcmf_cfg80211_set_power_mgmt: power save enabled
  ted Network Service.
  Apr 23 03:57:39 ubuntu systemd-networkd[1687]: wlan0: IPv6 successfully enabled
  Apr 23 03:57:39 ubuntu systemd-networkd[1687]: eth0: IPv6 successfully enabled
  Apr 23 03:57:39 ubuntu kernel: brcmfmac: brcmf_cfg80211_set_power_mgmt: power save enabled
  Apr 23 03:57:39 ubuntu systemd-networkd[1687]: wlan0: Link UP

  $ 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,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
      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,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN group default qlen 1000
      link/ether dc:a6:32:57:b9:ba brd ff:ff:ff:ff:ff:ff
  3: wlan0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc fq_codel state DOWN group default qlen 1000
      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-networkd.service - Network Service
       Loaded: loaded (/lib/systemd/system/systemd-networkd.service; enabled; ven>
       Active: active (running) since Thu 2020-04-23 03:57:39 UTC; 1min 18s ago
  TriggeredBy: ● systemd-networkd.socket
         Docs: man:systemd-networkd.service(8)
     Main PID: 1687 (systemd-network)
       Status: "Processing requests..."
        Tasks: 1 (limit: 4434)
       CGroup: /system.slice/systemd-networkd.service
               └─1687 /lib/systemd/systemd-networkd

  Apr 23 03:57:39 ubuntu systemd[1]: Starting Network Service...
  Apr 23 03:57:39 ubuntu systemd-networkd[1687]: Enumeration completed
  Apr 23 03:57:39 ubuntu systemd[1]: Started Network Service.
  Apr 23 03:57:39 ubuntu systemd-networkd[1687]: wlan0: IPv6 successfully enabled
  Apr 23 03:57:39 ubuntu systemd-networkd[1687]: eth0: IPv6 successfully enabled
  Apr 23 03:57:39 ubuntu systemd-networkd[1687]: wlan0: Link UP

  $ 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-networkd.service: Succeeded.
  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-networkd[1722]: Enumeration completed
  Apr 23 03:59:40 ubuntu systemd[1]: Started Network Service.
  Apr 23 03:59:40 ubuntu sudo[1719]: pam_unix(sudo:session): session closed for user root
  Apr 23 03:59:40 ubuntu systemd-networkd[1722]: wlan0: IPv6 successfully enabled
  Apr 23 03:59:40 ubuntu systemd-networkd[1722]: eth0: IPv6 successfully enabled

  $ ip a
  1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
      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,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN group default qlen 1000
      link/ether dc:a6:32:57:b9:ba brd ff:ff:ff:ff:ff:ff
  3: wlan0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc fq_codel state DOWN group default qlen 1000
      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-wpa-wlan0.service
  ● netplan-wpa-wlan0.service - WPA supplicant for netplan wlan0
       Loaded: loaded (/run/systemd/system/netplan-wpa-wlan0.service; enabled-run>
       Active: inactive (dead)

  $ sudo systemctl restart netplan-wpa-wlan0.service

  Apr 23 04:01:25 ubuntu wpa_supplicant[1752]: Successfully initialized wpa_supplicant
  Apr 23 04:01:28 ubuntu wpa_supplicant[1752]: wlan0: Trying to associate with SSID 'ubuntu-cert-wpa'
  Apr 23 04:01:30 ubuntu wpa_supplicant[1752]: wlan0: CTRL-EVENT-ASSOC-REJECT bssid=00:00:00:00:00:00 status_code=16
  Apr 23 04:01:33 ubuntu wpa_supplicant[1752]: wlan0: Trying to associate with SSID 'ubuntu-cert-wpa'
  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[1752]: wlan0: Associated with 04:d9:f5:b4:f8:b8
  Apr 23 04:01:35 ubuntu wpa_supplicant[1752]: wlan0: CTRL-EVENT-CONNECTED - Connection to 04:d9:f5:b4:f8:b8 completed [id=0 id_str=]
  Apr 23 04:01:35 ubuntu wpa_supplicant[1752]: wlan0: CTRL-EVENT-SUBNET-STATUS-UPDATE status=0
  Apr 23 04:01:35 ubuntu kernel: IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
  Apr 23 04:01:35 ubuntu systemd-networkd[1722]: wlan0: Gained carrier
  Apr 23 04:01:35 ubuntu systemd-networkd[1722]: wlan0: Connected WiFi access point: ubuntu-cert-wpa (04:d9:f5:b4:f8:b8)
  Apr 23 04:01:36 ubuntu systemd-networkd[1722]: wlan0: DHCPv4 address 192.168.1.228/24 via 192.168.1.1
  Apr 23 04:01:36 ubuntu dbus-daemon[1297]: [system] Activating via systemd: service name='org.freedesktop.hostname1' unit='dbus-org.freedesktop.hostname1.service' requested by ':1.18' (uid=100 pid=1722 comm="/lib/systemd/systemd-networkd " label="unconfined")
  Apr 23 04:01:36 ubuntu systemd-timesyncd[1209]: Network configuration changed, trying to establish connection.
  Apr 23 04:01:36 ubuntu systemd[1]: Starting Hostname Service...
  Apr 23 04:02:02 ubuntu systemd-timesyncd[1209]: Initial synchronization to time server 91.189.94.4:123 (ntp.ubuntu.com).
  Apr 23 04:02:02 ubuntu dbus-daemon[1297]: [system] Successfully activated service 'org.freedesktop.hostname1'
  Apr 23 04:02:02 ubuntu systemd[1]: Started Hostname Service.
  Apr 23 04:02:03 ubuntu systemd-networkd[1722]: wlan0: Gained IPv6LL

  $ ip a
  1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
      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,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN group default qlen 1000
      link/ether dc:a6:32:57:b9:ba brd ff:ff:ff:ff:ff:ff
  3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
      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:32ff:fe57:b9bb/64 scope link
         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
  ProcVersionSignature: User Name 5.4.0-1008.8-raspi 5.4.29
  Uname: Linux 5.4.0-1008-raspi aarch64
  ApportVersion: 2.20.11-0ubuntu27
  Architecture: arm64
  CasperMD5CheckResult: skip
  Date: Thu Apr 23 04:14:27 2020
  SourcePackage: netplan.io
  UpgradeStatus: No upgrade log present (probably fresh install)

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/netplan.io/+bug/1874377/+subscriptions



More information about the foundations-bugs mailing list