From f96326de36f60b0f201e5dd16e6dd3f46909c4a7 Mon Sep 17 00:00:00 2001 From: clerie <git@clerie.de> Date: Sun, 16 Mar 2025 18:00:16 +0100 Subject: [PATCH] hosts/hydra-1: Migrate to systemd-network --- hosts/hydra-1/configuration.nix | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/hosts/hydra-1/configuration.nix b/hosts/hydra-1/configuration.nix index 94dcb5d..9788887 100644 --- a/hosts/hydra-1/configuration.nix +++ b/hosts/hydra-1/configuration.nix @@ -23,10 +23,28 @@ ]; networking.useDHCP = false; - networking.interfaces.ens18.ipv6.addresses = [ { address = "2001:638:904:ffcb::a"; prefixLength = 64; } ]; - networking.interfaces.ens19.ipv4.addresses = [ { address = "192.168.10.36"; prefixLength = 24; } ]; - networking.defaultGateway6 = { address = "2001:638:904:ffcb::1"; interface = "ens18"; }; - networking.defaultGateway = { address = "192.168.10.1"; interface = "ens19"; }; + systemd.network.enable = true; + + systemd.network.networks."10-wan" = { + matchConfig.Name = "ens18"; + address = [ + "2001:638:904:ffcb::a/64" + ]; + routes = [ + { Gateway = "2001:638:904:ffcb::1"; } + ]; + linkConfig.RequiredForOnline = "routable"; + }; + systemd.network.networks."10-nat-netz-mercury" = { + matchConfig.Name = "ens19"; + address = [ + "192.168.10.36/24" + ]; + routes = [ + { Gateway = "192.168.10.1"; } + ]; + linkConfig.RequiredForOnline = "routable"; + }; services.nginx.enable = true;