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

Moviuro moviuro at gmail.com
Fri Aug 29 13:13:51 PDT 2014


On Friday 29 August 2014 15:00:06 you wrote:
> 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

So, actually, the VPN server should push the routes to me (just noticed indeed 
this strange workaroud I used). However, when the openvpn server pushes its 
routes, ip route add fails:

openvpn at profile[6649]: /usr/bin/ip route add 10.3.14.0/24 via 10.3.16.1
openvpn at profile[6649]: ERROR: Linux route add command failed: external program 
exited with error status: 2

I'm looking into this issue.

Cheers,
-- 
Moviuro @ Schizophrenia
"Our life is the immortals' death"
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.freedesktop.org/archives/systemd-devel/attachments/20140829/d6063d44/attachment.sig>


More information about the systemd-devel mailing list