From 7141a7fadd39966909e92a7363ca02088547cfca Mon Sep 17 00:00:00 2001 From: clerie <git@clerie.de> Date: Sun, 16 Mar 2025 18:12:39 +0100 Subject: [PATCH] hosts/hydra-2: Migrate to systemd-network --- hosts/hydra-2/configuration.nix | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/hosts/hydra-2/configuration.nix b/hosts/hydra-2/configuration.nix index 0081606..8b32cc2 100644 --- a/hosts/hydra-2/configuration.nix +++ b/hosts/hydra-2/configuration.nix @@ -19,10 +19,20 @@ ]; networking.useDHCP = false; - networking.interfaces.ens18.ipv6.addresses = [ { address = "2001:638:904:ffc1::100"; prefixLength = 64; } ]; - networking.interfaces.ens18.ipv4.addresses = [ { address = "141.24.50.112"; prefixLength = 24; } ]; - networking.defaultGateway6 = { address = "2001:638:904:ffc1::1"; interface = "ens18"; }; - networking.defaultGateway = { address = "141.24.50.1"; interface = "ens18"; }; + systemd.network.enable = true; + + systemd.network.networks."10-wan" = { + matchConfig.Name = "ens18"; + address = [ + "2001:638:904:ffc1::100/64" + "141.24.50.112/24" + ]; + routes = [ + { Gateway = "2001:638:904:ffc1::1"; } + { Gateway = "141.24.50.1"; } + ]; + linkConfig.RequiredForOnline = "routable"; + }; clerie.monitoring = { enable = true;