nixos/network-interfaces-systemd: do not ignore /0 gateway routes
While it might seem odd, 0.0.0.0/0 or ::/0 gateways are valid and commonly used on point-to-point links (e.g. a wireguard tunnel) to indicate that all traffic needs to be sent to a given interface. systemd-networkd actually documents this as a valid configuration in its man pages [1]. Tested to do the right thing in one of my NixOS containers using a Wireguard tunnel as its default route. [1] https://www.freedesktop.org/software/systemd/man/systemd.network.html#DefaultRouteOnDevice=
This commit is contained in:
parent
5efa052928
commit
4ae5da5394
1 changed files with 1 additions and 1 deletions
|
@ -134,7 +134,7 @@ in
|
|||
# Most of these route options have not been tested.
|
||||
# Please fix or report any mistakes you may find.
|
||||
routeConfig =
|
||||
optionalAttrs (route.prefixLength > 0) {
|
||||
optionalAttrs (route.address != null && route.prefixLength != null) {
|
||||
Destination = "${route.address}/${toString route.prefixLength}";
|
||||
} //
|
||||
optionalAttrs (route.options ? fastopen_no_cookie) {
|
||||
|
|
Loading…
Reference in a new issue