Configuration files for networkd are created when NetworkManager is the default renderer
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Netplan |
New
|
Undecided
|
Unassigned | ||
systemd (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
This is happening in a UC image created with a gadget that disables console-conf:
$ ubuntu-image snap --snap=
The snaps are:
$ snap list
Name Version Rev Tracking Publisher Notes
core22 20240321 1344 latest/edge canonical✓ base
network-manager 1.36.6-9 876 22/stable canonical✓ -
pc 22-0.3 x1 - - gadget
pc-kernel 5.15.0-102.112.1+1 1731 22/beta canonical✓ kernel
snapd 2.62+git2017.
On first boot, the content in /etc/netplan is:
ubuntu@ubuntu:~$ cat /etc/netplan/
network:
renderer: NetworkManager
ubuntu@ubuntu:~$ cat /etc/netplan/
# This file is generated from information provided by the datasource. Changes
# to it will not persist across an instance reboot. To disable cloud-init's
# network configuration capabilities, write a file
# /etc/cloud/
# network: {config: disabled}
network:
ethernets:
ens3:
dhcp4: true
match:
version: 2
But we have a configuration file for systemd-networkd that should not be there:
ubuntu@ubuntu:~$ cat /run/systemd/
[Match]
PermanentMACAdd
[Link]
Name=ens3
WakeOnLan=off
ubuntu@ubuntu:~$ networkctl
IDX LINK TYPE OPERATIONAL SETUP
1 lo loopback carrier unmanaged
2 ens3 ether routable configured
While having to:
ubuntu@ubuntu:~$ sudo cat /run/NetworkMan
[connection]
id=netplan-ens3
type=ethernet
interface-name=ens3
[ethernet]
wake-on-lan=0
[ipv4]
method=auto
[ipv6]
method=ignore
ubuntu@ubuntu:~$ nmcli c
NAME UUID TYPE DEVICE
netplan-ens3 bec3d02a-
ubuntu@ubuntu:~$ nmcli d
DEVICE TYPE STATE CONNECTION
ens3 ethernet connected netplan-ens3
lo loopback unmanaged --
Interestingly, networkd seems to take control of the interface after 6-8 minutes from boot. Initially, the state of ens3 is "unconfigured". State of the link before taking control is:
$ cat /run/systemd/ netif/links/ 2 unmanaged STATE=carrier STATE=routable STATE=routable STATE=degraded FOR_ONLINE= yes OPER_STATE_ FOR_ONLINE= degraded FAMILY_ FOR_ONLINE= any POLICY= up FILE=/run/ systemd/ network/ 10-netplan- ens3.network /run/systemd/ netif/leases/ 2 DUID=DUID- EN/Vendor: 0000ab11c03a37a e49cc0a3d0000
ADMIN_STATE=
OPER_STATE=routable
CARRIER_
ADDRESS_
IPV4_ADDRESS_
IPV6_ADDRESS_
ONLINE_STATE=online
REQUIRED_
REQUIRED_
REQUIRED_
ACTIVATION_
NETWORK_
DNS=10.0.2.3
NTP=
SIP=
DOMAINS=
ROUTE_DOMAINS=
LLMNR=yes
MDNS=no
DHCP_LEASE=
DHCP6_CLIENT_
After control is taken, it is the same except ADMIN_STATE= configured.
After reboot, if forcing a restart of networkd:
$ cat /run/systemd/ netif/links/ 2 unmanaged STATE=carrier STATE=routable STATE=routable STATE=degraded
# This is private data. Do not parse.
ADMIN_STATE=
OPER_STATE=routable
CARRIER_
ADDRESS_
IPV4_ADDRESS_
IPV6_ADDRESS_