Due to some network peculiarities involving VPNs and conflicting IP ranges, I have two subnets routing to two different interfaces. I would like to make one IP address in one subnet go out via a different gateway.
I can accomplish this by running:
$ route add -host 22.214.171.124 gw 126.96.36.199 $ ip route show 188.8.131.52 via 184.108.40.206 dev eth0 scope link
I would like to make this change permanent. As I'm using systemd-networkd, I am trying to do this by updating the existing
[Match] Name=eth0 [Network] DHCP=ipv4 [Route] #Gateway=220.127.116.11 Destination=18.104.22.168/32
This works, but without the
Gateway line it doesn't set the route:
$ ip route show 22.214.171.124 dev eth0 proto static scope link
If I uncomment the
Gateway line then the new route does not appear at all!
How can I specify a gateway when adding the static route using systemd-networkd?