diff --git a/hosts/router/configuration.nix b/hosts/router/configuration.nix index 26c872d..048c7d3 100644 --- a/hosts/router/configuration.nix +++ b/hosts/router/configuration.nix @@ -7,6 +7,7 @@ ./nat.nix ./ppp.nix + ./prefix-delegation.nix ./uplink-selector.nix ./10-net-services.nix @@ -32,8 +33,6 @@ networking.hostName = "router"; - networking.useDHCP = false; - networking.defaultGateway = { address = "10.42.10.1"; interface = "net-services"; }; networking.defaultGateway6 = { address = "2a01:4f8:1c0c:8221::1"; interface = "net-services"; }; diff --git a/hosts/router/prefix-delegation.nix b/hosts/router/prefix-delegation.nix new file mode 100644 index 0000000..c2a6a83 --- /dev/null +++ b/hosts/router/prefix-delegation.nix @@ -0,0 +1,34 @@ +{ config, pkgs, ... }: + +{ + networking.interfaces.net-ikt.useDHCP = true; + networking.interfaces.net-technik.useDHCP = true; + networking.interfaces.net-hospital.useDHCP = true; + networking.interfaces.net-zoll.useDHCP = true; + networking.interfaces.net-leitstelle.useDHCP = true; + networking.interfaces.net-verwaltung.useDHCP = true; + networking.interfaces.net-yolo.useDHCP = true; + networking.interfaces.net-infojurte.useDHCP = true; + networking.interfaces.net-internation.useDHCP = true; + networking.interfaces.net-programmtre.useDHCP = true; + networking.interfaces.net-open-office.useDHCP = true; + + networking.dhcpcd = { + enable = true; + allowInterfaces = [ + "net-*" + "ppp-*" + ]; + wait = "ipv6"; + extraConfig = '' + ipv6only + noipv6rs + interface ppp-uplink-a + ipv6rs + ip_pd 1/::/56 net-hospital/203/64 net-zoll/204/64 net-leitstelle/205/64 net-verwaltung/206/64 + interface ppp-uplink-b + ipv6rs + ip_pd 1/::/56 net-ikt/201/64 net-technik/202/64 net-yolo/208/64 net-infojurte/209/64 net-internation/210/64 net-programmtre/211/64 net-open-office/212/64 + ''; + }; +}