Skip to content

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?

1 points1 comments
Open on Reddit
About this post
Posted
Archived
Score
1 · 100% up
Kind
Text
ID
iosn90

Author

1
posts
7
comments
0
media
View profile

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.

1 points

Keyboard shortcuts

Move and act

jork
Next / previous post or comment
Enteroro
Open the post
f
Open the media viewer
s
Save
h
Hide (the toast has Undo)
Tab
Right after an action: the toast's Undo
x
Collapse the comment
v
Next layout: cards, compact, grid

Go to

/
Search
gthenh
Home
gthena
All
gthens
Subreddits
gthenl
Library
?
This list
Esc
Close a menu or this list

In the viewer

←or→
Previous / next file
↑or↓
Previous / next post
korj
Previous / next post
Space
Play / pause
m
Mute
z
Zoom
s
Save
o
Open the post (on its own page: back to it)
Esc
Close

Keys do nothing while you type in a box.