You are not logged in.

#1 2015-03-11 19:44:03

dexgeh
Member
Registered: 2012-10-15
Posts: 5

configure vps network with systemd-networkd

I got a vps and installed archlinux on it, but I can't get the network working using systemd-networkd.
The mail from the provider have the ip address and gateway (in the rest of the post are redacted respectively 1.2.3.4 and 5.6.7.8), and a note to run two commands after the network setup if configured manually:

route add 5.6.7.8/32 dev eth0
route add default gw 5.6.7.8

I translated the network configuration via the ip utility with:

ip addr add 1.2.3.4 dev ens3
ip link set dev ens3 up
ip route add 5.6.7.8/32 dev ens3
ip route add default via 5.6.7.8

With this configuration the network is running, without problems.
The output for ip route is:

default via 5.6.7.8 dev ens3
5.6.7.8 dev ens3 scope link

Now I'm trying to get the same configuration using systemd-networkd.
I wrote the following config file:

$ cat /etc/systemd/network/ens3.network
[Match]
Name=ens3
[Address]
Address=1.2.3.4/32
[Route]
Destination=5.6.7.8/32
[Route]
Gateway=5.6.7.8

After starting systemd-networkd the output from ip addr is the same; the output from ip route is:

5.6.7.8 dev ens3 proto static

The network is working partially, I can only ping the gateway, but the rest of the internet is unreachable.

I read the fine manual, systemd-network(5) and systemd-networkd(8), but I can't get what I'm missing in the network configuration.
Any help?

Offline

#2 2015-03-11 21:37:32

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,776

Re: configure vps network with systemd-networkd

I'm not sure how gracefully systemd-networkd handles having two [Route] sections in your config, it may be ignoring the Gateway line.
Try this...

[Match]
Name=ens3
[Address]
Address=1.2.3.4/32
[Route]
Destination=5.6.7.8/32
Gateway=5.6.7.8

No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

#3 2015-03-11 22:05:48

dexgeh
Member
Registered: 2012-10-15
Posts: 5

Re: configure vps network with systemd-networkd

Tried this way, ip route output now is empty.

On journalctl -xe it says:

ens3: could not set route: Network is unreachable.

The multiple [Route] way seems supported:
http://www.freedesktop.org/software/sys … %20Options

Specify several "[Route]" sections to configure several routes.

Offline

Board footer

Powered by FluxBB