Comment 0 for bug 2072522

Revision history for this message
greenmoss (ktyubuntu) wrote :

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

The Netplan configuration in `/etc/netplan/60-docker-access.yaml`, per stackoverflow link, and absent routing:
```
network:
  vlans:
    mynet-shim:
      id: 0
      link: eno1
      addresses: [10.100.0.16/32]
```

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