My netplan file looks like so:
network:
version: 2
renderer: networkd
ethernets:
eth0:
addresses:
- 169.254.1.1/24
mtu: 9000
After boot the eth0
interface takes the configured address, but the MTU is the default value of 1500.
If I run sudo netplan apply
manually after boot, then the MTU increases to 9000 as expected.
Right after boot, the generated files for systemd-networkd
look like so. These files do not change after manually applying the second time.
$ cat /run/systemd/network/10-netplan-eth0.link
[Match]
OriginalName=eth0
[Link]
WakeOnLan=off
MTUBytes=9000
$ cat /run/systemd/network/10-netplan-eth0.network
[Match]
Name=eth0
[Network]
Address=169.254.1.1/24
Nothing obvious stands out to me in the log of systemd-networkd
, other than the order being different:
# at boot
Dec 13 06:29:35 ifcb110 systemd-networkd[3233]: eth0: IPv6 successfully enabled
Dec 13 06:29:35 ifcb110 systemd-networkd[3233]: eth0: Link UP
Dec 13 06:29:38 ifcb110 systemd-networkd[3233]: eth0: Gained carrier
Dec 13 06:29:39 ifcb110 systemd-networkd[3233]: eth0: Gained IPv6LL
Dec 13 06:29:39 ifcb110 systemd-networkd[3233]: eth0: Configured
# second time that works
Dec 13 06:39:46 ifcb110 systemd-networkd[6781]: eth0: Gained IPv6LL
Dec 13 06:39:46 ifcb110 systemd-networkd[6781]: eth0: Link is not managed by us
Dec 13 06:39:46 ifcb110 systemd-networkd[6781]: eth0: IPv6 successfully enabled
Dec 13 06:39:49 ifcb110 systemd-networkd[6781]: eth0: Gained carrier
Dec 13 06:39:49 ifcb110 systemd-networkd[6781]: eth0: Configured
Here's what netplan --debug apply
outputs (abridged):
$ sudo netplan --debug apply
** (generate:7015): DEBUG: 06:50:14.054: Processing input file //etc/netplan/config.yaml..
** (generate:7015): DEBUG: 06:50:14.054: starting new processing pass
** (generate:7015): DEBUG: 06:50:14.054: eth0: setting default backend to 1
** (generate:7015): DEBUG: 06:50:14.054: Generating output files..
** (generate:7015): DEBUG: 06:50:14.055: NetworkManager: definition eth0 is not for us (backend 1)
DEBUG:netplan generated networkd configuration exists, restarting networkd
DEBUG:no netplan generated NM configuration exists
DEBUG:device eth0 operstate is up, not replugging
DEBUG:netplan triggering .link rules for eth0
What might be preventing the setting from taking effect the first time?
(I suspect something like a race between the eth0
interface becoming available and applying the udev rules in the .link file.)