Package: cloud.debian.org
Version: debian-11-generic-amd64-20230124-1270.qcow2
In the cloud-init “network-config” file (using “Networking Config Version 2”)
when using static network addressing, it is possible to define static routes
under an interface.
These routes can be either IPv4 or IPv6 routes. These are then placed into
/etc/network/interfaces.d/50-cloud-init by the cloud unit scripts.
The same script correctly creates two stanzas in the file for an interface that
has both an IPv4 and an IPv6 address, as “iface inet static” and “iface
inet6 static”.
The script also correctly changes the syntax of the “route” command to add “-A
inet6” for IPv6 routes.
However, the script places all static routes under the “iface inet static”
stanza. This means that the IPv6 routes don’t (usually) work, as the system
(usually) attempts to configure them before the IPv6 address has been
configured on the interface.
If I manually cut and paste the routes to the “iface inet6 static” stanza
and restart the interface then the routes come up correctly.
I know that the networking for cloud-init will change in Debian 12 away from
using ifupdown, but it would still be useful to have this fixed for Debian 11,
as some people will still be running with that for a year or more.
If fixing this isn’t going to happen, could you let me know which script file
is creating the 50-cloud-init file from the network-config file, so I can have
a look into creating a local fix.
Thanks
Michael