wakeonlan with networkd requires MAC address explicitly otherwise it will be ignored

Bug #1909114 reported by Nobuto Murata
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Netplan
Fix Released
Undecided
Unassigned

Bug Description

"wakeonlan" property doesn't work out of the box, and it requires explicit "match" with MAC address. However, it's not documented explicitly in the reference:
https://github.com/CanonicalLtd/netplan/blob/41bfbd6db8ad8126f00a73eb6fdda637d7a717eb/doc/netplan.md#common-properties-for-physical-device-types

> wakeonlan (bool)
>
> : Enable wake on LAN. Off by default.

[doesn't work]

$ cat /etc/netplan/00-installer-config.yaml
# This is the network config written by 'subiquity'
network:
  ethernets:
    enp31s0:
      dhcp4: true
      wakeonlan: true ## <----
  version: 2

The button line of the error[1] is:
-> enp31s0: Config file /run/systemd/network/10-netplan-enp31s0.link matches device based on renamed interface name, ignoring

[works]

$ cat /etc/netplan/00-installer-config.yaml
# This is the network config written by 'subiquity'
network:
  ethernets:
    enp31s0:
      match:
        macaddress: 70:85:c2:ae:bc:08 ## <----
      dhcp4: true
      wakeonlan: true ## <----
  version: 2

-> enp31s0: Config file /run/systemd/network/10-netplan-enp31s0.link is applied

[1]
$ sudo SYSTEMD_LOG_LEVEL=debug udevadm test-builtin net_setup_link /sys/class/net/enp31s0
Trying to open "/etc/systemd/hwdb/hwdb.bin"...
Trying to open "/etc/udev/hwdb.bin"...
Trying to open "/usr/lib/systemd/hwdb/hwdb.bin"...
Trying to open "/lib/systemd/hwdb/hwdb.bin"...
Trying to open "/lib/udev/hwdb.bin"...
=== trie on-disk ===
tool version: 245
file size: 9953169 bytes
header size 80 bytes
strings 2163737 bytes
nodes 7789352 bytes
Load module index
Found container virtualization none.
timestamp of '/etc/systemd/network' changed
timestamp of '/run/systemd/network' changed
Parsed configuration file /usr/lib/systemd/network/99-default.link
Parsed configuration file /usr/lib/systemd/network/73-usb-net-by-mac.link
Parsed configuration file /run/systemd/network/10-netplan-enp31s0.link
Created link configuration context.
ID_NET_DRIVER=r8169
enp31s0: Device has name_assign_type=4
enp31s0: Config file /run/systemd/network/10-netplan-enp31s0.link matches device based on renamed interface name, ignoring
enp31s0: Config file /usr/lib/systemd/network/99-default.link is applied
ethtool: autonegotiation is unset or enabled, the speed and duplex are not writable.
enp31s0: Device has name_assign_type=4
Using default interface naming scheme 'v245'.
enp31s0: Policy *keep*: keeping existing userspace name
enp31s0: Device has addr_assign_type=0
enp31s0: MAC on the device already matches policy *persistent*
ID_NET_LINK_FILE=/usr/lib/systemd/network/99-default.link
Unload module index
Unloaded link configuration context.

[2]
$ sudo SYSTEMD_LOG_LEVEL=debug udevadm test-builtin net_setup_link /sys/class/net/enp31s0
Trying to open "/etc/systemd/hwdb/hwdb.bin"...
Trying to open "/etc/udev/hwdb.bin"...
Trying to open "/usr/lib/systemd/hwdb/hwdb.bin"...
Trying to open "/lib/systemd/hwdb/hwdb.bin"...
Trying to open "/lib/udev/hwdb.bin"...
=== trie on-disk ===
tool version: 245
file size: 9953169 bytes
header size 80 bytes
strings 2163737 bytes
nodes 7789352 bytes
Load module index
Found container virtualization none.
timestamp of '/etc/systemd/network' changed
timestamp of '/run/systemd/network' changed
Parsed configuration file /usr/lib/systemd/network/99-default.link
Parsed configuration file /usr/lib/systemd/network/73-usb-net-by-mac.link
Parsed configuration file /run/systemd/network/10-netplan-enp31s0.link
Created link configuration context.
ID_NET_DRIVER=r8169
enp31s0: Config file /run/systemd/network/10-netplan-enp31s0.link is applied
ethtool: autonegotiation is unset or enabled, the speed and duplex are not writable.
enp31s0: Device has name_assign_type=4
Using default interface naming scheme 'v245'.
enp31s0: Policies didn't yield a name and Name= is not given, not renaming.
ID_NET_LINK_FILE=/run/systemd/network/10-netplan-enp31s0.link
Unload module index
Unloaded link configuration context.

Revision history for this message
Nobuto Murata (nobuto) wrote :
Revision history for this message
Lukas Märdian (slyon) wrote :

Thanks for the pull request, I merged your documentation update upstream.

Changed in netplan:
status: New → Fix Committed
Revision history for this message
Lukas Märdian (slyon) wrote :

Released in v0.102

Changed in netplan:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.