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