Arch VPS can't set static route
I'm having problems setting the IP routes for my VPS. It's set up using systemd-networkd, but I'm getting errors. The server starts with no routes set at all and is unreachable except through the provider direct console.
$ cat /etc/systemd/network/default.network
[Match]
Name=eth0
[Network]
Gateway=172.31.1.1
Address=116.203.@@@.@@@/32
During startup I get the following:
systemd[1]: Starting Network Service...
systemd-networkd[236]: Enumeration completed
systemd-networkd[236]: eth0: IPv6 successfully enabled
systemd-networkd[236]: eth0: Link UP
systemd[1]: Started Network Service.
systemd-networkd[236]: eth0: Gained carrier
systemd-networkd[236]: eth0: Could not set route: Nexthop has invalid gateway. Network is unreachable
systemd-networkd[236]: eth0: Failed
Manually adding the routes works, except it's lost on reboot
# ip route add 172.31.1.1 dev eth0 scope link
# ip route add default via 172.31.1.1 dev eth0
Is this some sort of VPS timing issue? How can I fix this?
About this post
- Posted
- Archived
- Score
- 1 · 100% up
- Kind
- Text
- ID
- iosn90
1 comment
Not well versed in networkd, but in general, gateway and interface IP belonging to different subnets should be nonsensical, unless it's a point-to-point link.