← Back to team overview

debcrafters-packages team mailing list archive

[Bug 2098183] Re: Preserve IPv6 configurations when `KeepConfiguration=dhcp-on-stop` is set

 

The proposed package for Noble has been tested, and all results are as
expected.

> apt policy systemd
systemd:
  Installed: 255.4-1ubuntu8.9
  Candidate: 255.4-1ubuntu8.9
  Version table:
 *** 255.4-1ubuntu8.9 100
        100 http://iad-ad-3.clouds.archive.ubuntu.com/ubuntu noble-proposed/main amd64 Packages
        100 /var/lib/dpkg/status
     255.4-1ubuntu8.8 500
        500 http://iad-ad-3.clouds.archive.ubuntu.com/ubuntu noble-updates/main amd64 Packages
        500 http://security.ubuntu.com/ubuntu noble-security/main amd64 Packages
     255.4-1ubuntu8 500
        500 http://iad-ad-3.clouds.archive.ubuntu.com/ubuntu noble/main amd64 Packages

<Verify the functionality of KeepConfiguration in preserving IPv6 configurations>
> iscsiadm -m session
tcp: [1] [fd00:00c1:0000:0000:0000:0000:a9fe:0002]:3260,1 iqn.2015-02.oracle.boot:uefi (non-flash)

<Verify the serialization and deserialization functionality in the systemd-networkd service>
2025-06-13T02:51:08.614755+00:00 chengen-noble systemd-networkd[1671]: Serializing...
2025-06-13T02:51:08.614801+00:00 chengen-noble systemd-networkd[1671]: enp0s9: Serializing DHCPv4 address (configured): 10.0.2.114/24 broadcast 10.0.2.255 (valid forever, preferred forever), flags: permanent, scope: global, label: n/a
2025-06-13T02:51:08.614833+00:00 chengen-noble systemd-networkd[1671]: enp0s9: Serializing DHCPv4 route (configured): dst: 169.254.169.254/32, src: n/a, gw: n/a, prefsrc: 10.0.2.114, scope: link, table: main(254), proto: dhcp, type: unicast, nexthop: 0, priority: 100, flags: n/a
2025-06-13T02:51:08.614861+00:00 chengen-noble systemd-networkd[1671]: enp0s9: Serializing DHCPv4 route (configured): dst: 169.254.0.0/16, src: n/a, gw: n/a, prefsrc: 10.0.2.114, scope: link, table: main(254), proto: dhcp, type: unicast, nexthop: 0, priority: 100, flags: n/a
2025-06-13T02:51:08.614885+00:00 chengen-noble systemd-networkd[1671]: enp0s9: Serializing DHCPv4 route (configured): dst: 10.0.2.1/32, src: n/a, gw: n/a, prefsrc: 10.0.2.114, scope: link, table: main(254), proto: dhcp, type: unicast, nexthop: 0, priority: 100, flags: n/a
2025-06-13T02:51:08.614908+00:00 chengen-noble systemd-networkd[1671]: enp0s9: Serializing DHCPv4 route (configured): dst: n/a, src: n/a, gw: 10.0.2.1, prefsrc: 10.0.2.114, scope: global, table: main(254), proto: dhcp, type: unicast, nexthop: 0, priority: 100, flags: n/a
2025-06-13T02:51:08.614935+00:00 chengen-noble systemd-networkd[1671]: Serialization completed.
...
2025-06-13T02:51:08.656979+00:00 chengen-noble systemd-networkd[1680]: Deserializing...
2025-06-13T02:51:08.657000+00:00 chengen-noble systemd-networkd[1680]: enp0s9: Deserialized DHCPv4 address (configured): 10.0.2.114/24 broadcast 10.0.2.255 (valid forever, preferred forever), flags: permanent, scope: global, label: n/a
2025-06-13T02:51:08.657023+00:00 chengen-noble systemd-networkd[1680]: enp0s9: Deserialized DHCPv4 route (configured): dst: 169.254.169.254/32, src: n/a, gw: n/a, prefsrc: 10.0.2.114, scope: link, table: main(254), proto: dhcp, type: unicast, nexthop: 0, priority: 100, flags: n/a
2025-06-13T02:51:08.657043+00:00 chengen-noble systemd-networkd[1680]: enp0s9: Deserialized DHCPv4 route (configured): dst: 169.254.0.0/16, src: n/a, gw: n/a, prefsrc: 10.0.2.114, scope: link, table: main(254), proto: dhcp, type: unicast, nexthop: 0, priority: 100, flags: n/a
2025-06-13T02:51:08.657066+00:00 chengen-noble systemd-networkd[1680]: enp0s9: Deserialized DHCPv4 route (configured): dst: 10.0.2.1/32, src: n/a, gw: n/a, prefsrc: 10.0.2.114, scope: link, table: main(254), proto: dhcp, type: unicast, nexthop: 0, priority: 100, flags: n/a
2025-06-13T02:51:08.657089+00:00 chengen-noble systemd-networkd[1680]: enp0s9: Deserialized DHCPv4 route (configured): dst: n/a, src: n/a, gw: 10.0.2.1, prefsrc: 10.0.2.114, scope: global, table: main(254), proto: dhcp, type: unicast, nexthop: 0, priority: 100, flags: n/a
2025-06-13T02:51:08.657109+00:00 chengen-noble systemd-networkd[1680]: Deserialization completed.

<Verify that the IP address is removed when KeepConfiguration=no is set>
> ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host noprefixroute 
       valid_lft forever preferred_lft forever
2: enp0s9: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 9000 qdisc mq state UP group default qlen 1000
    link/ether 02:00:17:35:ba:97 brd ff:ff:ff:ff:ff:ff
    inet 10.0.2.114/24 metric 100 brd 10.0.2.255 scope global dynamic enp0s9
       valid_lft 86398sec preferred_lft 86398sec
    inet6 2603:c020:4016:8201:c4eb:7288:6176:4b1e/128 scope global tentative dynamic noprefixroute 
       valid_lft 89999sec preferred_lft 86399sec
    inet6 fe80::17ff:fe35:ba97/64 scope link 
       valid_lft forever preferred_lft forever
> systemctl stop systemd-networkd.socket
> systemctl stop systemd-networkd
> ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host noprefixroute 
       valid_lft forever preferred_lft forever
2: enp0s9: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 9000 qdisc mq state UP group default qlen 1000
    link/ether 02:00:17:35:ba:97 brd ff:ff:ff:ff:ff:ff
    inet6 fe80::17ff:fe35:ba97/64 scope link 
       valid_lft forever preferred_lft forever

** Tags removed: verification-needed verification-needed-noble
** Tags added: verification-done verification-done-noble

-- 
You received this bug notification because you are a member of
Debcrafters packages, which is subscribed to systemd in Ubuntu.
https://bugs.launchpad.net/bugs/2098183

Title:
  Preserve IPv6 configurations when `KeepConfiguration=dhcp-on-stop` is
  set

Status in systemd package in Ubuntu:
  Fix Released
Status in systemd source package in Focal:
  Won't Fix
Status in systemd source package in Jammy:
  Won't Fix
Status in systemd source package in Noble:
  Fix Committed
Status in systemd source package in Oracular:
  Won't Fix
Status in systemd source package in Plucky:
  Fix Released

Bug description:
  [Impact]
  The IPv6 configuration is being cleared even though `KeepConfiguration` is set to `yes`, causing the iSCSI backend system to hang during shutdown.

  [Fix]
  Systemd upstream has addressed this issue.
  https://github.com/systemd/systemd/pull/34989

  [Test Plan]
  <Verify the functionality of KeepConfiguration in preserving IPv6 configurations>
  1. Set up a machine with an iSCSI backend in an IPv6-only environment.
  2. Configure the `KeepConfiguration` option for each network device individually using drop-in configuration files (e.g., `/etc/systemd/network/*.network.d/*.conf`) or set the `"critical"` option to `true` in the Netplan configuration.
  3. Power off the machine and verify that the system does not hang.

  <Verify the serialization and deserialization functionality in the systemd-networkd service>
  1. Enable debugging for systemd-networkd
  > mkdir -p /etc/systemd/system/systemd-networkd.service.d/
  > vim /etc/systemd/system/systemd-networkd.service.d/10-debug.conf
  ===
  [Service]
  Environment=SYSTEMD_LOG_LEVEL=debug
  ===
  systemctl daemon-reload
  2. Restart the systemd-networkd service twice using the `systemctl restart systemd-networkd` command.
  3. Confirm that serialization and deserialization are functioning correctly by checking `/var/log/syslog`
  2025-03-13T00:35:01.540134+00:00 oracular systemd-networkd[2998]: Serializing...
  2025-03-13T00:35:01.540165+00:00 oracular systemd-networkd[2998]: enp0s9: Serializing DHCPv4 address (configured): 10.0.2.100/24 broadcast 10.0.2.255 (valid forever, preferred forever), flags: permanent, scope: global, label: n/a
  2025-03-13T00:35:01.540193+00:00 oracular systemd-networkd[2998]: enp0s9: Serializing DHCPv6 address (configured): 2603:c020:4016:8201:48ee:6b22:d3e4:2e8/128 (valid for 1d 56min 49s, preferred for 23h 56min 49s), flags: no-prefixroute, scope: global
  2025-03-13T00:35:01.540218+00:00 oracular systemd-networkd[2998]: Serialization completed.
  ...
  2025-03-13T00:35:01.596591+00:00 oracular systemd-networkd[3029]: Deserializing...
  2025-03-13T00:35:01.596612+00:00 oracular systemd-networkd[3029]: enp0s9: Deserialized DHCPv4 address (configured): 10.0.2.100/24 broadcast 10.0.2.255 (valid forever, preferred forever), flags: permanent, scope: global, label: n/a
  2025-03-13T00:35:01.596635+00:00 oracular systemd-networkd[3029]: enp0s9: Deserialized DHCPv6 address (configured): 2603:c020:4016:8201:48ee:6b22:d3e4:2e8/128 (valid for 1d 56min 49s, preferred for 23h 56min 49s), flags: no-prefixroute, scope: global
  2025-03-13T00:35:01.596662+00:00 oracular systemd-networkd[3029]: Deserialization completed.

  <Verify that the IP address is removed when KeepConfiguration=no is set>
  1. Check the name of the current network configuration file:
  > ls /run/systemd/network/
  10-netplan-enp0s9.link 10-netplan-enp0s9.network
  2. Create a drop-in directory and override the KeepConfiguration setting:
  > mkdir -p /etc/systemd/network/10-netplan-enp0s9.network.d
  > vim /etc/systemd/network/10-netplan-enp0s9.network.d/10-netplan-enp0s9.network.conf
  ===
  [Network]
  KeepConfiguration=no
  ===
  3. Restart the systemd-networkd service to apply the changes:
  > systemctl restart systemd-networkd
  4. Stop the systemd-networkd service and verify the IP address is dropped:
  > systemctl stop systemd-networkd
  > ip a

  [Where problems could occur]
  The patches introduce network serialization and deserialization behavior, ensuring that DHCPv6 addresses are preserved when `KeepConfiguration=yes` is set. If any regressions occur, error messages may appear when restarting `systemd-networkd`, but they will be ignored. Both IPv4/IPv6 configuration and the IPv6 connection may be affected.

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