Please allow netplan to specify route proto

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

Bug Description

TL;DR:

The following Netplan config
```
      routes:
        - to: 10.100.1.15/32
          scope: link
```

produces route
```
10.100.1.15 dev mynet-shim proto static scope link
```

However I want this instead (note the absent `proto static`):
```
10.100.0.15 dev mynet-shim scope link
```
Which was produced using:
```
ip route add 10.100.0.15/32 dev mynet-shim
```

Background:

I am using a network shim to connect to an IP address of a local Docker container. The Docker container has IP 10.100.0.15. Technique described here: https://stackoverflow.com/questions/49600665/docker-macvlan-network-inside-container-is-not-reaching-to-its-own-host/64360858#64360858

Here's my routing workaround script `/etc/networkd-dispatcher/routable.d/50-route-mynet-shim`, which would be nice to move to Netplan:
```
#!/bin/sh
/sbin/ip route add 10.100.0.15/32 dev mynet-shim
```

Info on route proto boot vs route proto static: https://utcc.utoronto.ca/~cks/space/blog/linux/IpRouteProtoWhat

Tags: route
greenmoss (ktyubuntu)
description: updated
Revision history for this message
Lukas Märdian (slyon) wrote (last edit ):

This seems to be supported by systemd-networkd, generally ("proto static" being the default): https://www.freedesktop.org/software/systemd/man/latest/systemd.network.html#Protocol=

Do you know if the Protocol field can be set via NetworkManager, too? What's the config option?

Can you please give some more context on the usecase, why you want to change this setting? It seems to be mostly for informational purposes for the sysadmin (about the route origin, e.g. "kernel", "dhcp", "boot", "static", "ra"). Maybe it should be set to "proto netplan" implicitly, instead of making it a dynamic config option?

I'm marking it as a wishlist item, additional details could also be discussed in a future pull-request.

Changed in netplan:
importance: Undecided → Wishlist
status: New → Triaged
Revision history for this message
greenmoss (ktyubuntu) wrote :

The use case is setting up a network shim so I can contact a MacVLAN IP from the host system.

I don't know why `proto static` breaks things. However if I use Netplan to set the route and it adds `proto static`, then the network shim reliably breaks.

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.