How to setup static IP with gateway IP out of the subnet using systemd-networkd?
Basically what i want to do is:
~$ ip addr add 51.255.174.122/32 dev eth0
~$ ip route add 51.255.68.1 dev eth0
~$ ip route add default via 51.255.68.1
what i tried is: /etc/systemd/network/wired.network
[Match]
Name=eth0
[Network]
Address=51.255.174.122/32
Gateway=51.255.68.1
when i tried ip route
there is no output. What have i done wrong and what is the correct way to do this ?
Gateway=51.255.68.1 try with GatewayOnLink= in route section it should work. https://www.freedesktop.org/software/systemd/man/systemd.network.html#GatewayOnlink=