From 1febb230d49f725bfb77fa1fd005807122180ba6 Mon Sep 17 00:00:00 2001 From: Linnea Gräf Date: Fri, 13 Dec 2024 01:36:31 +0100 Subject: use systemd networking again --- srv/h-alpha/hardware-configuration.nix | 62 ++++++++++++++++++++++++++-------- 1 file changed, 48 insertions(+), 14 deletions(-) diff --git a/srv/h-alpha/hardware-configuration.nix b/srv/h-alpha/hardware-configuration.nix index 868ec92..c59f5a7 100644 --- a/srv/h-alpha/hardware-configuration.nix +++ b/srv/h-alpha/hardware-configuration.nix @@ -22,20 +22,54 @@ boot.kernelModules = [ ]; boot.extraModulePackages = [ ]; swapDevices = [ ]; - networking = { - useDHCP = false; - defaultGateway6 = { - address = "fe80::1"; - interface = "enp1s0"; - }; - interfaces.enp1s0 = { - ipv6.addresses = [ - { - address = "2a01:4f9:c012:5dd3::"; - prefixLength = 64; - } - ]; - }; + + networking.useNetworkd = true; + systemd.network.networks."30-wan" = { + matchConfig.Name = "enp1s0"; + addresses = [ + "2a01:4f9:c012:5dd3::/64" + "65.21.54.251" + ]; + + routes = [ + { routeConfig.Gateway = "fe80::1"; } + { + routeConfig = { + Destination = "172.31.1.1"; + }; + } + { + routeConfig = { + Gateway = "172.31.1.1"; + GatewayOnLink = true; + }; + } + { + routeConfig = { + Destination = "172.16.0.0/12"; + Type = "unreachable"; + }; + } + { + routeConfig = { + Destination = "192.168.0.0/16"; + Type = "unreachable"; + }; + } + { + routeConfig = { + Destination = "10.0.0.0/8"; + Type = "unreachable"; + }; + } + { + routeConfig = { + Destination = "fc00::/7"; + Type = "unreachable"; + }; + } + ]; }; + nixpkgs.hostPlatform = lib.mkDefault "aarch64-linux"; } -- cgit