from key in routes generates incorrect networkd configuration
Bug #1767849 reported by
djGrrr
This bug affects 2 people
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Netplan |
Fix Released
|
Undecided
|
Daniel Axtens | ||
netplan.io (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
Xenial |
Fix Released
|
Undecided
|
Unassigned | ||
Bionic |
Fix Released
|
Undecided
|
Unassigned | ||
Cosmic |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
When you use netplan's "from" key under routes, the systemd-networkd .network file generated uses the wrong variable name "From", when it should be using "Source".
And networkd generates a warning and ignores it as a result:
systemd-
I have attached a very simple patch which should fix the problem.
To post a comment you must log in.
Hello,
Thank you for reporting this issue and helping make Ubuntu better.
Can you include which Ubuntu release, systemd and netplan package version you were using?
I don't believe there is support in netplan 'routes' for a 'from' field, though I see that it does accept the value
network: policy:
version: 2
renderer: networkd
ethernets:
eth0:
addresses:
- 192.168.3.30/24
dhcp4: no
routes:
- to: 192.168.3.0/24
via: 192.168.3.1
table: 101
from: 10.0.0.1
routing-
- from: 192.168.3.0/24
table: 101
Generates:
root@b1: /run/systemd/ network# cat 10-netplan- eth0.network
[Match]
Name=eth0
[Network] 192.168. 3.30/24
Address=
[Route] 192.168. 3.0/24
Destination=
Gateway=192.168.3.1
From=10.0.0.1
Table=101
[RoutingPolicyRule]
From=192.168.3.0/24
Table=101
Which then systemd-networkd does complain about a From= in a [Routes] section which isn't supported.
However, I believe you want to use the 'routing-policy' to set the From value for a particular route.
Please confirm if using routing-policy allows you to get the configuration you need. If the configuration can't be achieved with the policy, please include your netplan config as you have it now and an ip route show all to help indicate which route you need to add.
Netplan shouldn't render From= in the [Routes] section for sure.