Systemd-networkd equivilent of “ip rule add…”

iproute2networkingsystemd

Basically the title says it all, what would be the equivalent to

ip rule add from 10.10.0.10/32 table 2
ip rule add to 10.10.0.10/32 table 2

in systemd-networkd?

I tried to setup something like

[Route]
Destination 10.10.0.10/32
Table=2

but this is not doing the trick and the manpages do not mention anything in this regards.

Best Answer

If you have systemd 235 or higher, you can use the following:

[RoutingPolicyRule]
From=10.10.0.10/32
Table=2

[RoutingPolicyRule]
To=10.10.0.10/32
Table=2

Full documentation can be found here.