I've just upgraded my VMs to one-context 6.8 which comes with the migration from /etc/network/interfaces/ to netplan, and it seems to be breaking configurations where the gateway is on-link (outside the subnet of the main ip address).
My autogenerated /etc/network/interfaces looks like this:
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
address REDACTED.237
network REDACTED.237
netmask 255.255.255.255
gateway REDACTED.232
And this is the default route it creates:
root@core:~# ip r
default via REDACTED.232 dev eth0 onlink
Autogenerated /etc/netplan/50-one-context.yaml instead looks like this:
With this, my VMs come up without a default route:
root@core:~# ip r
root@core:~#
I've worked the issue around by rolling back to the previous mechanism (NETCFG_TYPE="interfaces") but would be interested in figuring out a solution to make it work with netplan.
Either of the following netplan configs work for this use case. In the first, I create an additional route to tell the system REDACTED.232 is on-link, and then use REDACTED.232 as default gw as normal.
In the second option (probably cleaner), I directly add the on-link flag to the default route. In this config, metric: 0 doesn't seem to work (no route is created), so I bumped it to 100 (which works as intended).
As a side question - I have updated the file manually and it works but at reboot one-context does overwrite it. Is there a way to prevent this? Can't seem to find a solution in the docs.
I've just upgraded my VMs to one-context 6.8 which comes with the migration from
/etc/network/interfaces/
to netplan, and it seems to be breaking configurations where the gateway is on-link (outside the subnet of the main ip address).My autogenerated
/etc/network/interfaces
looks like this:And this is the default route it creates:
Autogenerated
/etc/netplan/50-one-context.yaml
instead looks like this:With this, my VMs come up without a default route:
I've worked the issue around by rolling back to the previous mechanism (
NETCFG_TYPE="interfaces"
) but would be interested in figuring out a solution to make it work with netplan.Either of the following netplan configs work for this use case. In the first, I create an additional route to tell the system
REDACTED.232
is on-link, and then useREDACTED.232
as default gw as normal.In the second option (probably cleaner), I directly add the on-link flag to the default route. In this config,
metric: 0
doesn't seem to work (no route is created), so I bumped it to 100 (which works as intended).Netplan's reference docs (https://netplan.readthedocs.io/en/stable/netplan-yaml/) state the value of "metric" must be "a positive integer value", you might want to skip 0 as it seems to have unintended consequences in cases like the above. None of their examples (https://netplan.readthedocs.io/en/latest/examples/) has
metric: 0
.A similar issue has been reported here https://forum.opennebula.io/t/debian-12-from-marketplace-netplan-does-not-apply-context-with-netplan/12008 with no solution.