should be possible to specify static routes on a dhcp-configured interface
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Netplan |
Confirmed
|
Low
|
Unassigned | ||
systemd (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
From <https:/
This doesn't work with direct netplan yaml, because networkd will try to apply the static routes before the interface has been configured via dhcp, failing because there is not yet a route to the gateway on that interface.
Demonstrating in a lxd container locally, which has 10.44.49.0/24 as its network:
$ cat /etc/netplan/
# This file is generated from information provided by
# the datasource. Changes to it will not persist across an instance.
# To disable cloud-init's network configuration capabilities, write a file
# /etc/cloud/
# network: {config: disabled}
network:
version: 2
ethernets:
eth0:
dhcp4: true
routes:
- to: 10.44.48.0/24
$ systemctl status systemd-networkd --no-pager -l
● systemd-
Loaded: loaded (/lib/systemd/
Active: active (running) since Fri 2018-07-13 19:21:29 UTC; 8min ago
Docs: man:systemd-
Main PID: 165 (systemd-network)
Status: "Processing requests..."
Tasks: 1 (limit: 4915)
CGroup: /system.
└─165 /lib/systemd/
Jul 13 19:21:29 stable-dane systemd[1]: Starting Network Service...
Jul 13 19:21:29 stable-dane systemd-
Jul 13 19:21:29 stable-dane systemd[1]: Started Network Service.
Jul 13 19:21:29 stable-dane systemd-
Jul 13 19:21:29 stable-dane systemd-
Jul 13 19:21:29 stable-dane systemd-
Jul 13 19:21:29 stable-dane systemd-
Jul 13 19:21:29 stable-dane systemd-
Jul 13 19:21:55 stable-dane systemd-
$ ip route
default via 10.44.49.1 dev eth0 proto dhcp src 10.44.49.32 metric 100
10.44.49.0/24 dev eth0 proto kernel scope link src 10.44.49.32
10.44.49.1 dev eth0 proto dhcp scope link src 10.44.49.32 metric 100
$
netplan and networkd should DTRT.
Changed in netplan: | |
importance: | Undecided → Low |
Status changed to 'Confirmed' because the bug affects multiple users.