Hello Lars, or anyone else affected,

Accepted systemd into bionic-proposed. The package will build now and be
available at
https://launchpad.net/ubuntu/+source/systemd/237-3ubuntu10.39 in a few
hours, and then in the -proposed repository.

Please help us by testing this new package.  See
https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how
to enable and use -proposed.  Your feedback will aid us getting this
update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug,
mentioning the version of the package you tested and change the tag from
verification-needed-bionic to verification-done-bionic. If it does not
fix the bug for you, please add a comment stating that, and change the
tag to verification-failed-bionic. In either case, without details of
your testing we will not be able to proceed.

Further information regarding the verification process can be found at
https://wiki.ubuntu.com/QATeam/PerformingSRUVerification .  Thank you in
advance for helping!

N.B. The updated package will be released to -updates after the bug(s)
fixed by this package have been verified and the package has been in
-proposed for a minimum of 7 days.

** Changed in: systemd (Ubuntu Bionic)
       Status: In Progress => Fix Committed

** Tags removed: verification-failed verification-failed-bionic
** Tags added: verification-needed verification-needed-bionic

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

Title:
  systemd-networkd fails to apply static IPv4 when the static IP is the
  same as previously configured by DHCP

Status in systemd:
  Fix Released
Status in systemd package in Ubuntu:
  Fix Released
Status in systemd source package in Bionic:
  Fix Committed
Status in systemd source package in Disco:
  Won't Fix

Bug description:
  [impact]

  if networkd is configured with a static address, and the address has
  already been assigned by dhcp (so that it has finite valid_lft),
  networkd will not change the valid_lft to 'forever' during startup,
  which leaves networkd thinking the address is static (meaning,
  networkd will not attempt to renew the dhcp lease) but the address
  valid_lft counting down.

  Once the valid_lft expires, the kernel will remove the address from
  the interface, breaking the system's networking.

  [test case]

  configure a system with networkd similar to:

  [Match]
  Name=ens3

  [Network]
  DHCP=ipv4

  restart systemd-networkd, and ens3 should get a DHCP address, e.g.:

  $ ip -4 a show ens3
  2: ens3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP 
group default qlen 1000
      inet 192.168.122.147/24 brd 192.168.122.255 scope global dynamic ens3
         valid_lft 2295sec preferred_lft 2295sec

  then, edit the networkd config to use a static address, e.g.:

  [Match]
  Name=ens3

  [Network]
  Address=192.168.122.147/24
  Gateway=192.168.122.1
  DNS=192.168.122.1
  Domains=vm

  make sure to use the exact same address that was provided by dhcp.

  Then, without rebooting, just restart networkd and check the address
  lft:

  $ sudo systemctl restart systemd-networkd

  $ ip -4 a show ens3
  2: ens3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP 
group default qlen 1000
      inet 192.168.122.147/24 brd 192.168.122.255 scope global dynamic ens3
         valid_lft 2992sec preferred_lft 2992sec

  the address should have 'forever' valid_lft, but it doesn't.

  [regression potential]

  this changes the details of how networkd updates static addresses
  during startup, so any regression would occur at networkd startup when
  using static addresses.

  [scope]

  this is needed only in Bionic and Disco.

  this is fixed by upstream:
  https://github.com/systemd/systemd/pull/11460/commits
  specifically commit a47a6daebe0af26c07d8d423225eb4add110793c
  which is included in Eoan and later.

  In Xenial using networkd, testing shows this problem does not occur,
  because this older version of networkd removes the 'foreign' dhcp
  address before re-assigning it as a static address.

  [other info]

  original description:
  ---

  In bionic, running systemd 237-3ubuntu10.22 and netplan.io
  0.97-0ubuntu1~18.04.1, systemd-networkd fails to configure an
  interface with a static IPv4 address if the statically confiugred
  address is the same as the interface already has gotten from DHCP.

  This will cause the interface to loose its IP address when the DHCP
  lease exires, even though you've told netplan to configure it as
  static.

  I expect systemd-networkd to actually configure an IP address as
  static, regardless of what address the interface has before from DHCP.

  # lsb_release  -rd
  Description:  Ubuntu 18.04.2 LTS
  Release:      18.04

  # apt-cache policy systemd
  systemd:
    Installed: 237-3ubuntu10.22

  # apt-cache policy netplan.io
  netplan.io:
    Installed: 0.97-0ubuntu1~18.04.1

  A paste of systemd-networkd's debug log when I run "netplan apply" and
  the interface already has the static IP configured from DHCP.

  It seems like upon a restart, systemd-networkd will allways add
  whatever IP config it had before the service stopped, and then apply
  changes (if any). Since my new config has the same IP as it already
  had, it does nothing even though the new config has static
  configuration.

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

-- 
Mailing list: https://launchpad.net/~touch-packages
Post to     : touch-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~touch-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to