systemd-networkd is not honoring UseRoutes=false
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
systemd (Ubuntu) |
Triaged
|
Undecided
|
Unassigned |
Bug Description
When netplan configures dhcp4-overrides and set "use-routes" to false, systemd-networkd should be configured with UseRoutes=false. It is. Unfortunately looks like systemd-networkd is not honoring it and configuring the default gateways for the interfaces no matter what.
Ubuntu Focal: systemd: 245.4-2ubuntu1
----
$ sudo cat /etc/netplan/
network:
ethernets:
enp5s0:
match:
dhcp4: true
enp6s0:
match:
dhcp4: true
enp7s0:
match:
dhcp4: true
version: 2
renderer: networkd
----
$ cat /var/run/
[Match]
MACAddress=
Name=iscsi01
[Network]
DHCP=ipv4
LinkLocalAddres
[DHCP]
ClientIdentifie
RouteMetric=100
UseMTU=true
UseRoutes=false
--
$ ip route show | grep default
default via 10.250.93.1 dev iscsi02 proto dhcp src 10.250.93.101 metric 100
default via 10.250.94.1 dev iscsi01 proto dhcp src 10.250.94.167 metric 100
default via 10.250.97.1 dev eth0 proto dhcp src 10.250.97.123 metric 100
Changed in systemd (Ubuntu): | |
status: | New → Confirmed |
status: | Confirmed → Triaged |
description: | updated |
upstream systemd has actually changed the behavior of UseRoutes; now, it only disables actual defined routes provided by dhcp, and does not control the gateway route. There is a new option, UseGateway, that controls if the dhcp-provided gateway route should be used or not.
More details in bug 1867375 as well as references to the upstream changes. As noted in my comment there, if UseGateway is backported to Bionic, its default needs adjustment to default to the provided value of UseRoutes; maybe that should be done for Focal as well.