In /lib/systemd/network/10-eth0.network
on my client, I am failing to configure anything that can translate my manual command:
sudo ip route add default via 192.168.7.1 dev eth0
where 192.168.7.1
is the static IPv4 address of my host.
My last 10-eth0.network
configuration attempt:
[Match] Name=eth0 [Link] RequiredForOnline=no [Route] Address=192.168.7.2/24 Destination=192.168.7.1/32 Gateway=192.168.7.1
Refreshed with sudo systemctl restart systemd-networkd
and validated with ip route
(it doesn't show up).
See also:
[Route]
Section Options- Answers that aren't working: systemd-networkd and direct routes
192.168.7.1
is arbitrary host Ethernet port to client's192.168.7.2
Ethernet port.192.168.7.1
is not a router per se. Router is in another subnet block, e.g.10.0.0.1
.192.168.7.1
is an Ethernet interface of machine that is supposed to forward traffic via its WAN interface for the192.168.7.2
'edge'/'client' device.