Only one route is generated from multiple files with different tables and same vlan
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Netplan |
Triaged
|
Medium
|
Danilo Egea Gondolfo |
Bug Description
Suppose the following 3 files exist in /etc/netplan.
# 01-netcfg.yaml
network:
version: 2
renderer: networkd
ethernets:
eth0:
dhcp4: false
dhcp6: false
addresses: [172.17.17.151/20]
routes:
- to: default
via: 172.17.17.1
nameservers:
addresses: [4.2.2.1, 4.2.2.2, 208.67.220.220]
vlans:
vlan100:
id: 100
link: eth0
addresses: [10.0.0.
# 10-table1.yaml
network:
version: 2
vlans:
vlan100:
routing-
- from: 10.0.0.1
table: 1001
routes:
- to: 0.0.0.0/0
via: 10.0.0.100
table: 1001
# 10-table2.yaml
network:
version: 2
vlans:
vlan100:
routing-
- from: 10.0.0.2
table: 1002
routes:
- to: 0.0.0.0/0
via: 10.0.0.200
table: 1002
Then, `netplan apply` generates a route for table 1001 only.
# output of netplan apply
network:
version: 2
renderer: networkd
ethernets:
eth0:
addresses:
- "172.17.17.151/20"
nameservers:
addresses:
- 4.2.2.1
- 4.2.2.2
- 208.67.220.220
dhcp4: false
dhcp6: false
routes:
- to: "default"
via: "172.17.17.1"
vlans:
vlan100:
addresses:
- "10.0.0.1/24"
- "10.0.0.2/24"
routes:
- table: 1001
to: "0.0.0.0/0"
via: "10.0.0.100"
routing-
- table: 1001
from: "10.0.0.1"
- table: 1002
from: "10.0.0.2"
id: 100
link: "eth0"
Expected `network.
# part of expected output
routes:
- table: 1001
to: "0.0.0.0/0"
via: "10.0.0.100"
- table: 1002
to: "0.0.0.0/0"
via: "10.0.0.200"
If 10-table1.yaml and 10-table2.yaml are merged to one file like below, `network.
# 20-merged.yaml
network:
version: 2
vlans:
vlan100:
routing-
- from: 10.0.0.1
table: 1001
- from: 10.0.0.2
table: 1002
routes:
- to: 0.0.0.0/0
via: 10.0.0.100
table: 1001
- to: 0.0.0.0/0
via: 10.0.0.200
table: 1002
Same contents in Gist for readability.
https:/
Indeed, I think something might be wrong with netplan's additive route merging logic.