Public bug reported:

[Impact]
The systemd-networkd restart operation unexpectedly removes DHCP dynamic 
addresses and routes even with KeepConfiguration=yes/true, on Ubuntu 24.04. 
This is a 100% reproducible regression in my environment.

[Environment]
OS: Ubuntu 24.04.3
systemd: systemd:255.4-1ubuntu8.12 (255.4-1ubuntu8.17 also has the same issue)

During this bug fix process 
https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/2098183,
Ubuntu backported upstream systemd-networkd serialization/deserialization 
support from upstream PR #34989 to fix DHCP/NDisc configuration loss when 
systemd-networkd is stopped.

However, this change appears to have introduced a regression during 
systemd-networkd restarts:
1. When the old systemd-networkd exits, it serializes dynamically acquired 
configuration, such as DHCPv4/DHCPv6/NDisc addresses and routes.
2. When the new systemd-networkd starts, it first enumerates the existing 
kernel address/route objects as foreign. Then manager_deserialize() matches 
them with the serialized state and restores their source, for example:
NETWORK_CONFIG_SOURCE_FOREIGN -> NETWORK_CONFIG_SOURCE_DHCP4
3. After that, the old v255 cleanup path runs link_drop_managed_config(). In 
v255, link_drop_managed_addresses() skips only foreign addresses. Since the 
deserialized DHCP/NDisc address is no longer foreign, it is treated as managed 
configuration and removed.

[Result]
Restarting systemd-networkd unexpectedly triggers deletion of DHCP/NDisc 
dynamic configuration.

[Expected result]
Restarting systemd-networkd should not remove existing DHCP dynamic 
configuration, especially when KeepConfiguration=yes is configured.

[Steps to reproduce the problem]
1. Make sure that KeepConfiguration is set to true/yes: 
root@xxx:/etc/netplan# cat /run/systemd/network/10-netplan-eth0.network
[Match]
Name=eth0

[Network]
DHCP=ipv4
LinkLocalAddressing=ipv6
KeepConfiguration=true

[DHCP]
RouteMetric=100
UseMTU=true

2. Restart systemd-networkd: 
systemctl restart systemd-networkd

3. I observed through the ip monitor that the DHCP address was deleted: 
root@xxx:/etc/netplan# ip -ts monitor link address route dev eth0
[2026-10-13T16:22:44.564824] Deleted 192.168.122.1 proto dhcp scope link src 
192.168.122.113 metric 100
[2026-10-13T16:22:44.565428] Deleted default via 192.168.122.1 proto dhcp src 
192.168.122.113 metric 100
[2026-10-13T16:22:44.566066] Deleted 2: eth0    inet 192.168.122.113/24 metric 
100 brd 192.168.122.255 scope global eth0
       valid_lft forever preferred_lft forever
[2026-10-13T16:22:44.567151] Deleted 192.168.122.0/24 proto kernel scope link 
src 192.168.122.113 metric 100
[2026-10-13T16:22:44.567816] Deleted broadcast 192.168.122.255 table local 
proto kernel scope link src 192.168.122.113
[2026-10-13T16:22:44.568545] Deleted local 192.168.122.113 table local proto 
kernel scope host src 192.168.122.113
[2026-10-13T16:22:44.603101] 2: eth0    inet 192.168.122.113/24 metric 100 brd 
192.168.122.255 scope global eth0
       valid_lft forever preferred_lft forever
[2026-10-13T16:22:44.604425] local 192.168.122.113 table local proto kernel 
scope host src 192.168.122.113
[2026-10-13T16:22:44.605296] broadcast 192.168.122.255 table local proto kernel 
scope link src 192.168.122.113
[2026-10-13T16:22:44.606257] 192.168.122.0/24 proto kernel scope link src 
192.168.122.113 metric 100
[2026-10-13T16:22:44.607310] 192.168.122.1 proto dhcp scope link src 
192.168.122.113 metric 100
[2026-10-13T16:22:44.608106] default via 192.168.122.1 proto dhcp src 
192.168.122.113 metric 100

[Upstream status]
Upstream later changed this area significantly. In particular:
https://github.com/systemd/systemd/commit/e09b758876219de8222df798114d1d63b0323b58

This commit renamed link_drop_managed_*() to link_drop_static_*() and
changed the semantics so that dynamic addresses are no longer removed by
that path.

issue: https://github.com/systemd/systemd/issues/36411

fix PR: https://github.com/systemd/systemd/pull/36414

This would preserve the intended LP: #2098183 fix while avoiding
deletion of deserialized dynamic network configuration during systemd-
networkd restart.

[Question]
Does Ubuntu 24.04 have any plans to fix this regression?

** Affects: systemd (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2170677

Title:
  systemd-networkd restart drops DHCP config with KeepConfiguration=yes

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/2170677/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to