I'm trying to use systemd-networkd to configure a static route. The actual IPs are different, but here's the gist of what I'm trying to do:

ip route add dev eth0

If I run this command, my networking setup works exactly as intended. I just need to establish connectivity between this host and the subnet. My host is on a different subnet, and it cannot route there on its own for some reason. Now I want to take that same static route and configure it via a systemd-networkd file.

Here is the config I've tried using


Gateway= # IP address of eth0 interface

I have also tried with Gateway set to the default gateway for the eth0 interface, but every time I get the same error:

eth0: Could not set route: Invalid argument

Any ideas what I could be doing here?

  • 1
    Did you configure a route to The kernel needs to know how to route traffic to the gateway, in order to use it as such for another route. Though in this case I would expect the error message Could not set route: Network is unreachable. – devurandom Jul 18 '18 at 21:29

If you run ip route add dev eth0, you'll get this in ip route show: dev eth0 scope link

Note the scope link part.

So try this in your networkd configuration:


Specifying a dummy gateway address should not be necessary then.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.