systemd-networkd and direct routes

So the solution here is a bit tricky: you need to add gateway as a pointopoint parameter with /32 mask. This works:

[Match]
Name=enp0s3

[Address]
Address=192.168.0.2
Peer=192.168.0.1/32

[Network]
Gateway=192.168.0.1

What you want is to specify how the Gateway can be reached via the local scope. That is it in fact reachable on the same segment. You example is merely missing the line Scope=link.

[Match]
Name=enp0s3

[Address]
Address=192.168.0.2/32

[Route]
Destination=192.168.0.1/32
Scope=link

[Route]
Gateway=192.168.0.1

None of the solutions proposed worked with systemd 237, because GatewayOnlink=true was missing.

I have been able to use a link-local IPv4 gateway with a /32 interface address with this configuration:

[Match]
Name=eth0

[Network]
Address=192.0.2.42/32

[Route]
Destination=169.254.1.1
Scope=link

[Route]
Gateway=169.254.1.1
GatewayOnlink=true