netplan ignores routes
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Netplan |
Fix Released
|
Medium
|
Unassigned | ||
netplan.io (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
Jammy |
Confirmed
|
Undecided
|
Unassigned | ||
Kinetic |
Won't Fix
|
Undecided
|
Unassigned |
Bug Description
I have 2 files in /etc/netplan. One is generated by cloud-init (50-cloud-
When "netplan generate" or "netplan get" runs, it ignores the route from the second file.
Example:
# This file is generated from information provided by the datasource. Changes
# to it will not persist across an instance reboot. To disable cloud-init's
# network configuration capabilities, write a file
# /etc/cloud/
# network: {config: disabled}
network:
version: 2
ethernets:
net0:
- 1.1.1.1/24 # not the real address of course
match:
- 8.8.8.8
- 8.8.4.4
routes:
- to: default
The other file 60-static.yaml:
network:
version: 2
ethernets:
net0:
- "2a02:eeee:
routes:
- to: "::/0"
via: 2a02:eeee:
When getting the configuration:
$ netplan get
network:
version: 2
ethernets:
net0:
match:
macaddress: "11:11:11:11:11:11"
addresses:
- "1.1.1.1/24"
- "2a02:eeee:
nameservers:
addresses:
- 8.8.8.8
- 8.8.4.4
search: []
set-name: "net0"
routes:
- to: "default"
via: "1.2.3.4"
The route from the second file is completely ignored.
Strangely enough, if you list multiple routes in the second file, the result does contain all of them.
Changed in netplan.io (Ubuntu): | |
status: | New → Fix Released |
This behaviour seems new in version 0.105-0ubuntu2~ 22.04.3. For earlier versions there were already (other) weirdnesses in the merging of the data from multiple files, which cause me to pull out my hair.