netplan does not allow a top-level 'routes' stanza

Bug #2022957 reported by Tilman Baumann
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Netplan
Triaged
Wishlist
Unassigned

Bug Description

Reading through documentation and specs I can see that routes are only allowed to be declared as per device configuration.

However there is no reason or need to do this. Routes are global elements and very rarely ever device specific.

It should be possible to define routes as top level elements.

The same is very much true for the default route settings too. This is just not a device specific configuration. Thankfully this syntax is already deprecated.

This is quite related to https://bugs.launchpad.net/netplan/+bug/1698024

Just because everyone else in the past did it wrong doesn't mean that we have to repeat this nonsense.

Chhers and thanks
 Tilman Baumann

Revision history for this message
Tilman Baumann (tilmanbaumann) wrote :

The existence of the `on-link` flag for routes pretty much says it all. :D

Revision history for this message
Danilo Egea Gondolfo (danilogondolfo) wrote :

Hello,

I like the idea of having a top level "routes" section (and nameservers). It probably would help with the management of a huge number of routes.

But because the way Netplan works, this approach would have some limitations I think...

So, Netplan basically creates a 1:1 mapping of interfaces and backend configuration files (networkd or Network Manager) and it relies on them to actually install the routes. In other words, Netplan doesn't configure your system's network but delegates it to one (or both) of the backends according to the network definition.

That means that even though the routes would be in a separate section, Netplan still would need to map each of them to an interface to generate the backend configuration. But that might not be possible in some situations. More specifically, when the route doesn't depend on the network interface (for example "ip route add blackhole 1.2.3.4/32") we'd need to select an arbitrary interface to associate this route with so the backend can install it. We could force the user to set the outgoing device for each route though. But would that be better than defining the route in the interface context?

Anyway, I think that allowing the user to group routes together in their own section is a nice idea. We'll try to revisit the topic in the near future.

Thanks!

Changed in netplan:
status: New → Triaged
importance: Undecided → Wishlist
Revision history for this message
Tilman Baumann (tilmanbaumann) wrote :

Ah so the issue is with the backends networkd and NetwrorkManager. That's a bummer.

I thought at least networkd would be a bit more progressive. But at first glance it doesn't seem to be.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.