diff options
| author | Linnea Gräf <nea@nea.moe> | 2024-12-13 01:36:31 +0100 |
|---|---|---|
| committer | Linnea Gräf <nea@nea.moe> | 2024-12-13 01:36:31 +0100 |
| commit | 1febb230d49f725bfb77fa1fd005807122180ba6 (patch) | |
| tree | a67b326a5c028290f627d12e33a8e4db58ce1879 | |
| parent | cc212a09089dce84def20b9831cfcb9860209264 (diff) | |
| download | nix-infra-1febb230d49f725bfb77fa1fd005807122180ba6.tar.gz nix-infra-1febb230d49f725bfb77fa1fd005807122180ba6.tar.bz2 nix-infra-1febb230d49f725bfb77fa1fd005807122180ba6.zip | |
use systemd networking again
| -rw-r--r-- | srv/h-alpha/hardware-configuration.nix | 62 |
1 files 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"; } |
