[Bug 1812760] Re: networkd: [Route] PreferredSource not working in *.network files

Richard Laager rlaager at wiktel.com
Tue Apr 9 05:25:55 UTC 2019


I was able to verify this on Bionic:

rlaager at bison:~$ ip -6 route show
2600:2600::/64 dev ens3 proto kernel metric 256 pref medium
fe80::/64 dev ens3 proto kernel metric 256 pref medium
default via 2600:2600::254 dev ens3 proto static metric 1024 pref medium
rlaager at bison:~$ sudo apt update
...
rlaager at bison:~$ sudo apt install -t bionic-proposed systemd
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  linux-image-4.15.0-34-generic linux-image-4.15.0-36-generic linux-image-4.15.0-43-generic linux-modules-4.15.0-34-generic linux-modules-4.15.0-36-generic linux-modules-4.15.0-43-generic
  linux-modules-extra-4.15.0-34-generic linux-modules-extra-4.15.0-36-generic linux-modules-extra-4.15.0-43-generic
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
  libnss-resolve libnss-systemd libsystemd0
Suggested packages:
  systemd-container policykit-1
Recommended packages:
  libpam-systemd
The following packages will be upgraded:
  libnss-resolve libnss-systemd libsystemd0 systemd
4 upgraded, 0 newly installed, 0 to remove and 80 not upgraded.
Need to get 3,318 kB of archives.
After this operation, 3,072 B of additional disk space will be used.
Do you want to continue? [Y/n] Y
Get:1 http://mirror.steadfast.net/ubuntu bionic-proposed/main amd64 libnss-systemd amd64 237-3ubuntu10.20 [105 kB]
Get:2 http://mirror.steadfast.net/ubuntu bionic-proposed/universe amd64 libnss-resolve amd64 237-3ubuntu10.20 [107 kB]
Get:3 http://mirror.steadfast.net/ubuntu bionic-proposed/main amd64 systemd amd64 237-3ubuntu10.20 [2,902 kB]
Get:4 http://mirror.steadfast.net/ubuntu bionic-proposed/main amd64 libsystemd0 amd64 237-3ubuntu10.20 [204 kB]
Fetched 3,318 kB in 0s (13.0 MB/s)    
(Reading database ... 64877 files and directories currently installed.)
Preparing to unpack .../libnss-systemd_237-3ubuntu10.20_amd64.deb ...
Unpacking libnss-systemd:amd64 (237-3ubuntu10.20) over (237-3ubuntu10.15) ...
Preparing to unpack .../libnss-resolve_237-3ubuntu10.20_amd64.deb ...
Unpacking libnss-resolve:amd64 (237-3ubuntu10.20) over (237-3ubuntu10.15) ...
Preparing to unpack .../systemd_237-3ubuntu10.20_amd64.deb ...
Unpacking systemd (237-3ubuntu10.20) over (237-3ubuntu10.15) ...
Preparing to unpack .../libsystemd0_237-3ubuntu10.20_amd64.deb ...
Unpacking libsystemd0:amd64 (237-3ubuntu10.20) over (237-3ubuntu10.15) ...
Setting up libsystemd0:amd64 (237-3ubuntu10.20) ...
Processing triggers for ureadahead (0.100.0-20) ...
Processing triggers for libc-bin (2.27-3ubuntu1) ...
Setting up systemd (237-3ubuntu10.20) ...
Setting up libnss-resolve:amd64 (237-3ubuntu10.20) ...
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
Processing triggers for dbus (1.12.2-1ubuntu1) ...
Setting up libnss-systemd:amd64 (237-3ubuntu10.20) ...
Processing triggers for libc-bin (2.27-3ubuntu1) ...
rlaager at bison:~$ sudo systemctl daemon-reload
rlaager at bison:~$ sudo netplan apply
rlaager at bison:~$ ip -6 route show
2600:2600::/64 dev ens3 proto static src 2600:2600::26 metric 255 pref medium
2600:2600::/64 dev ens3 proto kernel metric 256 pref medium
fe80::/64 dev ens3 proto kernel metric 256 pref medium
default via 2600:2600::254 dev ens3 proto static src 2600:2600::26 metric 1024 pref medium
rlaager at bison:~$ 


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

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

Title:
  networkd: [Route] PreferredSource not working in *.network files

Status in systemd:
  Unknown
Status in systemd package in Ubuntu:
  Fix Released
Status in systemd source package in Bionic:
  Fix Committed
Status in systemd source package in Cosmic:
  Fix Committed
Status in systemd source package in Disco:
  Fix Released

Bug description:
  [Impact]

  Users cannot create IPv6 routes that specify PreferredSource. This
  means that users cannot specify a number of valid IPv6 routes that are
  useful in some circumstances. These routes can be created with the
  'ip' tool, just not with systemd.

  This was reported upstream in systemd issue #5882 is fixed by pulling
  in the changes in systemd PR #11375 -
  https://github.com/systemd/systemd/pull/11375

  [Test Case]

  Start a Bionic or Cosmic VM.

  Add the following netplan yaml (adjust for ethernet card and MAC):

  network:
      version: 2
      ethernets:
          ens3:
              dhcp4: true
              match:
                  macaddress: 52:54:00:e2:c2:d7
              set-name: ens3
              addresses: ["fd8f:1d7d:b141::2/64", "fd8f:1d7d:b141::200/64"]
              routes:
                - to: "a::/16"
                  via: "fd8f:1d7d:b141::1"
                  from: "fd8f:1d7d:b141::2"
                - to: "fd8f:1d7d:b141::/64"
                  scope: link
                  from: "fd8f:1d7d:b141::2"
                  metric: 255

  Run netplan apply or reboot. Wait ~10s.

  Alternately, to test without netplan, configure systemd-networkd with:

  [Match]
  Name=ens3

  [Network]
  DHCP=ipv4
  LinkLocalAddressing=ipv6
  Address=fd8f:1d7d:b141::2/64
  Address=fd8f:1d7d:b141::200/64

  [Route]
  Destination=a::/16
  Gateway=fd8f:1d7d:b141::1
  PreferredSource=fd8f:1d7d:b141::2

  [Route]
  Destination=fd8f:1d7d:b141::/64
  PreferredSource=fd8f:1d7d:b141::2
  Scope=link
  Metric=255

  [DHCP]
  UseMTU=true
  RouteMetric=100


  Currently, ip -6 route will not include a route to "a::/16", and will
  not include the route to "fd8f:1d7d:b141::/64" that has
  "fd8f:1d7d:b141::2" as the source address - both those addresses will
  be missing.

  Correct behaviour is for ip -6 route to report the following:

  ubuntu at b-np:~$ ip -6 route
  a::/16 via fd8f:1d7d:b141::1 dev ens3 proto static src fd8f:1d7d:b141::2 metric 1024 pref medium
  fd8f:1d7d:b141::/64 dev ens3 proto static src fd8f:1d7d:b141::2 metric 255 pref medium
  fd8f:1d7d:b141::/64 dev ens3 proto kernel metric 256 pref medium
  fe80::/64 dev ens3 proto kernel metric 256 pref medium

  Check before and after upgrade that 'systemctl status network-
  online.target' shows that the target has been reached.

  [Regression Potential]

  This changes the state machine in systemd which configures the links.
  It passes systemd's internal tests, and has been approved by systemd
  maintainers, but it remains possible that the changes will break the
  configuration of obscure network setups.

  The backport requires pulling in two further commits that also change
  behaviour: currently systemd deletes all addresses and routes that
  were attached to an interface. With this change, it will only delete
  those that are not specified in the configuration files. A side effect
  of this is that restarting networkd will not cause remove/add netlink
  events to be emitted for these addresses, so if anyone is relying on
  this behavior this will break compatibility; but that is an unlikely
  thing to be relying on, and it seems worth this risk to reduce
  unnecessary network state changes.

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



More information about the foundations-bugs mailing list