<div dir="ltr">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?<div><br></div><div><a href="https://linux.die.net/man/8/ip">https://linux.die.net/man/8/ip</a><br></div><div><br></div><div>```</div><div>scope SCOPE_VAL</div><div> 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.</div><div>```</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, May 16, 2017 at 9:51 AM, Daniel Wang <span dir="ltr"><<a href="mailto:wonderfly@google.com" target="_blank">wonderfly@google.com</a>></span> wrote:<br><!--
--><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>I'd like to understand the rational behind defaulting to scope universe instead of scope link. <a href="https://github.com/systemd/systemd/blob/master/src/network/networkd-route.c#L71" target="_blank">https://github.com/systemd/<wbr>systemd/blob/master/src/<wbr>network/networkd-route.c#L71</a></div><div><br></div><div>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:</div><div><br></div><div><div># cat leases/3 | grep ROUTES</div><div>ROUTES=<a href="http://192.168.0.1/32,0.0.0.0" target="_blank">192.168.0.1/32,0.0.0.0</a> <a href="http://192.168.0.0/24,192.168.0.1" target="_blank">192.168.0.0/24,192.168.0.1</a></div></div><div><br></div><div>systemd was able to add the first route, as this:</div><div><br></div><div># ip route <!--
-->show</div><div><span style="font-family:Arial,Helvetica,sans-serif;font-size:13px">192.168.0.1 dev eth1 proto dhcp metric 1024</span><br></div><div><span style="font-family:Arial,Helvetica,sans-serif;font-size:13px"><br></span></div><div><span style="font-family:Arial,Helvetica,sans-serif;font-size:13px">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.</span></div><div><span style="font-family:Arial,Helvetica,sans-serif;font-size:13px"><br></span></div><div><span style="font-family:Arial,Helvetica,sans-serif;font-size:13px">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.</span></div><div><span style="font-family:Arial,Helvetica,sans-serif;font-size:13px"><br></span></div><div><span style="font-family:Arial,Helvetica,sans-serif;font-size:13px">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?</span></div><span class="HOEnZb"><font color="#888888"><div><br></div>-- <br><div class="m_3416192479939160497gmail_signature"><div dir="ltr"><div>Best,</div><div>Daniel</div></div></div>
</font></span></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div>Best,</div><div>Daniel</div></div></div>
</div>