[systemd-devel] Why is default route scope RT_SCOPE_UNIVERSE?

Daniel Wang wonderfly at google.com
Tue May 16 17:45:57 UTC 2017


Following up on this, the "ip route" command has some intelligence of
deciding what scope to use for a route, depending on its type. Does it make
sense for systemd to do something similar?

https://linux.die.net/man/8/ip

```
scope SCOPE_VAL
    the scope of the destinations covered by the route prefix. SCOPE_VAL
may be a number or a string from the file /etc/iproute2/rt_scopes. If this
parameter is omitted, ip assumes scope global for all gatewayed unicast
routes, scope link for direct unicast and broadcast routes and scope host
for local routes.
```

On Tue, May 16, 2017 at 9:51 AM, Daniel Wang <wonderfly at google.com> wrote:

> I'd like to understand the rational behind defaulting to scope universe
> instead of scope link. https://github.com/systemd/systemd/blob/master/src/
> network/networkd-route.c#L71
>
> I have a NIC configured through DHCP. The DHCP server sends two routes,
> one to the router, and the other to the rest of the LAN:
>
> # cat leases/3 | grep ROUTES
> ROUTES=192.168.0.1/32,0.0.0.0 192.168.0.0/24,192.168.0.1
>
> systemd was able to add the first route, as this:
>
> # ip route show
> 192.168.0.1 dev eth1 proto dhcp metric 1024
>
> And it failed to add the second, getting error "Network is unreachable". I
> think the kernel rejects it because it _doesn't know how to reach the
> router_, in this case 192.168.0.1, as I read somewhere that the route has
> to be configured link local.
>
> I understand that systemd is smart enough to add a link local route to the
> router, _if the router IP is included in the DHCP lease_. Unfortunately my
> DHCP server doesn't do so, and I don't see any RFC mandates that.
>
> I am trying to see if we can update our server implementation, but on the
> other hand I'd like to understand why systemd chose RC_SCOPE_UNIVERSE as
> its default?
>
> --
> Best,
> Daniel
>



-- 
Best,
Daniel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20170516/c4c29e72/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4849 bytes
Desc: S/MIME Cryptographic Signature
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20170516/c4c29e72/attachment.bin>


More information about the systemd-devel mailing list