I have a wired connection and a wireless connection configured in this way
[Match]
Name=eth01
[Network]
Address=10.0.0.120/24
Gateway=10.0.0.1
[Route]
Destination=0.0.0.0/0
Metric=1000
- I have tried 10.0.0.1 for Destination.
- I have tried leaving the
[Route]
section blank which by my reading of https://www.freedesktop.org/software/systemd/man/systemd.network.html should set that as the default route.
The wireless configuration is like this:
[Match]
Name=wlan0
[Network]
Address=10.0.0.129/24
Gateway=10.0.0.1
[Route]
Destination=0.0.0.0/0
Metric=2000
Again I have tried setting the Destination to the Gateway.
Whatever I try I get a routing like this :
default via 10.0.0.1 dev wlan0 proto static
default via 10.0.0.1 dev eth01 proto static
10.0.0.0/24 dev wlan0 proto kernel scope link src 10.0.0.129
10.0.0.0/24 dev eth01 proto kernel scope link src 10.0.0.120
10.0.0.1 dev wlan0 proto static metric 2000
But I want the default route to go through the wired device unless the wired device is not present.