1

I have a problem on Ubuntu Server 18.04 running on a RPi 3B+. When booting with only the wifi connection, the system hangs for 2 mins waiting on eth0 to connect. I've added optional: true, but it is ignored.

My /etc/netplan:

# This file is generated from information provided by
# the datasource.  Changes to it will not persist across an instance.
# To disable cloud-init's network configuration capabilities, write a file
# /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following:
# network: {config: disabled}
network:
    version: 2
    renderer: networkd
    ethernets:
        eth0:
            dhcp4: true
            match:
                macaddress: b8:27:eb:db:7f:54
            set-name: eth0
            optional: true
    wifis:
        wlan0:
            dhcp4: true
            access-points:
                "Lagrange Point 5G":
                     password: "*****"
            nameservers:
                addresses: [10.0.1.1, 8.8.8.8]

Here is the tail end of dmesg:

[   19.540586] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
[   19.540603] brcmfmac: power management disabled
[   19.546500] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[  145.054536] new mount options do not match the existing superblock, will be ignored
[  152.587186] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready

Anyone know what I'm doing wrong?

EDIT: Added requested info...

$ sudo lshw -C network
  *-network:0               
       description: Wireless interface
       physical id: 2
       logical name: wlan0
       serial: b8:27:eb:9f:ba:34
       capabilities: ethernet physical wireless
       configuration: broadcast=yes driver=brcmfmac driverversion=7.45.154 firmware=01-4fbe0b04 ip=10.0.1.38 multicast=yes wireless=IEEE 802.11
  *-network:1 DISABLED
       description: Ethernet interface
       physical id: 3
       logical name: eth0
       serial: b8:27:eb:ca:ef:61
       capacity: 1Gbit/s
       capabilities: ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd 1000bt-fd autonegotiation
       configuration: autonegotiation=on broadcast=yes driver=lan78xx driverversion=1.0.6 link=no multicast=yes port=MII

And confirming netplan configuration:

$ cat /etc/network/interfaces
# ifupdown has been replaced by netplan(5) on this system.  See
# /etc/netplan for current configuration.
# To re-enable ifupdown on this system, you can run:
#    sudo apt install ifupdown

Btw, I have confirmed the exact same behavior on two different Raspberry Pi 3B+s, just to rule out bad hardware.

Edit #2: I updated my netplan as suggested by @heynnema and ran:

$ sudo netplan --debug generate
DEBUG:command generate: running ['/lib/netplan/generate']
** (generate:2077): DEBUG: 19:40:02.567: Processing input file /etc/netplan/50-cloud-init.yaml..
** (generate:2077): DEBUG: 19:40:02.567: starting new processing pass
** (generate:2077): DEBUG: 19:40:02.568: wlan0: adding wifi AP 'Lagrange Point 5G'
** (generate:2077): DEBUG: 19:40:02.568: wlan0: setting default backend to 1
** (generate:2077): DEBUG: 19:40:02.568: eth0: setting default backend to 1
** (generate:2077): DEBUG: 19:40:02.568: Generating output files..
** (generate:2077): DEBUG: 19:40:02.568: wlan0: Creating wpa_supplicant configuration file run/netplan/wpa-wlan0.conf
** (generate:2077): DEBUG: 19:40:02.569: Creating wpa_supplicant service enablement link /run/systemd/system/multi-user.target.wants/netplan-wpa@wlan0.service
** (generate:2077): DEBUG: 19:40:02.569: NetworkManager: definition wlan0 is not for us (backend 1)
** (generate:2077): DEBUG: 19:40:02.569: NetworkManager: definition eth0 is not for us (backend 1)
DevLP
  • 11

3 Answers3

1

Your MAC address is wrong for eth0.

Try this .yaml file... keep the spacing, indentation, and no tabs...

network:
  version: 2
  renderer: networkd
  ethernets:
    eth0:
      dhcp4: true
      optional: true
  wifis:
    wlan0:
      dhcp4: true
      access-points:
        "Lagrange Point 5G":
          password: "*****"
      nameservers:
        addresses: [10.0.1.1, 8.8.8.8]

sudo netplan --debug generate # generate config files

sudo netplan apply # apply new configuration

reboot # reboot, and confirm proper operation

Update #1:

Ended up putting on Ubuntu Server 19.04 which provided direct support for the RPi 3B+, and editing the .yaml file to include optional: true. Now boot times are around 30 seconds!

heynnema
  • 73,649
0

Okay, I just couldn't leave this one alone... in for a penny, etc. I took @heynnema's advice and tried Ubuntu Server 19.04 and it worked beautifully. So, the answer is to go get it and forget 18.04 if you're on a Raspberry Pi 3B+ with this problem.

I did not try Ubuntu Server 18.10 as 19.04 had a statement claiming full support for the Raspberry Pi.

EDIT: I left the mac address match that Ubuntu 19 setup had added. Also, the "optional: true" is required. It boots now in 30s!

DevLP
  • 11
0

For me this helped with a problem when my online interface stuck in configuring state in the networkctl list, which causes a by default 2 min delay at boot (on Ubuntu Server 22.04 LTS) on a HPE MicroServer Gen8: https://askubuntu.com/a/1438478

In essence:

  1. enable accept_ra kernel option for related interface(s) via sysctl (ie. sysctl -w net.ipv6.conf.eno1.accept_ra=1
  2. add them to /etc/sysctl.conf to survive on reboot
  3. remove dhcp6, add accept_ra: true in netplan config for your configured interface(s) (if you have multiple and some are unused, add optional: true for the unused ones)
  4. run # netplan apply
  5. check with networkctl list to see if it says configured now
  6. you can also test it with just restarting the networkd wait service: # systemctl restart systemd-networkd-wait-online.service, which should succeed right away).
antivirtel
  • 3,685