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 188.8.131.52 gw 184.108.40.206 $ ip route show 220.127.116.11 via 18.104.22.168 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=22.214.171.124 Destination=126.96.36.199/32
This works, but without the
Gateway line it doesn't set the route:
$ ip route show 188.8.131.52 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?