[systemd-devel] Systemd-networkd doesn't add static routes anymore

Tom Gundersen teg at jklm.no
Fri Aug 29 06:00:06 PDT 2014


On Thu, Aug 28, 2014 at 5:27 PM, Moviuro <moviuro at gmail.com> wrote:
> I'm using systemd 216 on Archlinux (uptodate).
> Everything worked fine at last boot (systemd 215, kernel 3.14.1)
>
> Here is my tap0.network:
> [Match]
> Name=tap0
>
> [Network]
> DHCP=yes
>
> [Route]
> Gateway=10.3.16.1
> Destination=10.3.14.0/24
>
> [Route]
> Gateway=10.3.16.1
> Destination=10.3.15.0/24
>
> And the routes:
> % ip route show
> default via 192.168.1.1 dev wlan0  proto dhcp  metric 1024
> 10.3.16.0/24 dev tap0  proto kernel  scope link  src 10.3.16.201
> 192.168.1.0/24 dev wlan0  proto kernel  scope link  src 192.168.1.128
> 192.168.1.1 dev wlan0  proto dhcp  scope link  metric 1024
>
> And relevant journal snippet:
> Aug 28 15:37:01 systemd-networkd[371]: tap0 : gained carrier
> Aug 28 15:37:01 systemd-networkd[371]: tap0 : could not set route: Network is
> unreachable
> Aug 28 15:37:01 systemd-networkd[371]: tap0 : could not set route: Network is
> unreachable
> Aug 28 15:37:01 systemd-networkd[371]: tap0 : link configured
> Aug 28 15:37:01 systemd-networkd[371]: tap0 : DHCPv4 address 10.3.16.201/24
> Aug 28 15:37:01 systemd-networkd[371]: tap0 : link configured
> **At this point I do have all my routes**
> **Shutdown begins**
> Aug 28 16:58:54 systemd-networkd[371]: wlan0 : lost carrier
> Aug 28 16:58:54 systemd-networkd[371]: wlan0 : DHCP lease lost
> Aug 28 16:58:54 systemd-networkd[371]: tap0 : lost carrier
> Aug 28 16:58:54 systemd-networkd[371]: tap0 : DHCP lease lost
> -- Reboot --
> Aug 28 16:59:20 systemd-networkd[364]: rtnl: received address for a
> nonexistent link, ignoring
> Aug 28 16:59:20 systemd-networkd[364]: rtnl: received address for a
> nonexistent link, ignoring
> Aug 28 16:59:23 systemd-networkd[364]: wlan0 : gained carrier
> Aug 28 16:59:24 systemd-networkd[364]: wlan0 : DHCPv4 address 192.168.1.128/24
> via 192.168.1.1
> Aug 28 16:59:24 systemd-networkd[364]: wlan0 : link configured
> Aug 28 16:59:37 systemd-networkd[364]: rtnl: received address for a
> nonexistent link, ignoring
> Aug 28 16:59:37 systemd-networkd[364]: rtnl: received address for a
> nonexistent link, ignoring
> Aug 28 16:59:37 systemd-networkd[364]: tap0 : gained carrier
> Aug 28 16:59:37 systemd-networkd[364]: tap0 : could not set route: Network is
> unreachable
> Aug 28 16:59:37 systemd-networkd[364]: tap0 : could not set route: Network is
> unreachable
> Aug 28 16:59:37 systemd-networkd[364]: tap0 : DHCPv4 address 10.3.16.201/24
>
> Note that tap0 never becomes 'configured'.
> The man does not tell any changes in networkd configuration and my setup is >
> 2 months old.

What's happening (in case that was not obvious) is that your
statically configured routes depend on the address received over DHCP
to be configured before they are set up. The current code assumes that
there are no such dependencies so does the static and dynamic setup
independently (in parallel). I guess we should either support this
explicitly, or verify the config up-front and fail with a clearer
error message.

Out of interest, is there some way you could get these routes out of
your DHCP server (if the server sends routes we should set them up)? I
mean, your current config would fail if your DHCP server configuration
was changed, which does not sound ideal...

Cheers,

Tom


More information about the systemd-devel mailing list