Daniel Wang
2017-05-16 16:51:56 UTC
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?
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