diff --git a/hosts/carbon/configuration.nix b/hosts/carbon/configuration.nix index 08bb266..63a8393 100644 --- a/hosts/carbon/configuration.nix +++ b/hosts/carbon/configuration.nix @@ -7,6 +7,7 @@ ../../configuration/router ./dns.nix + ./net-heimnetz.nix ./ppp.nix ]; @@ -47,23 +48,6 @@ id = 102; interface = "enp1s0"; }; - ## Heimnetz - networking.vlans."enp1s0.201" = { - id = 201; - interface = "enp1s0"; - }; - networking.bridges."net-heimnetz".interfaces = [ - "enp1s0.201" - "enp2s0" - ]; - networking.interfaces."net-heimnetz".ipv6.addresses = [ - { address = "fe80::1"; prefixLength = 64; } - { address = "fd00:152:152:4::1"; prefixLength = 64; } - { address = "2001:4cd8:100:1337::1"; prefixLength = 64; } # public IPs for local network - ]; - networking.interfaces."net-heimnetz".ipv4.addresses = [ - { address = "10.152.4.1"; prefixLength = 24; } - ]; ## Gastnetz networking.vlans."enp1s0.202" = { id = 202; @@ -98,12 +82,6 @@ services.radvd.enable = true; services.radvd.config = '' - interface net-heimnetz { - AdvSendAdvert on; - prefix 2001:4cd8:100:1337::/64 {}; - RDNSS fd00:152:152::1 {}; - DNSSL net.clerie.de {}; - }; interface enp1s0.202 { AdvSendAdvert on; prefix 2001:4cd8:100:1313::/64 {}; @@ -115,7 +93,7 @@ enable = true; settings = { interfaces-config = { - interfaces = [ "net-heimnetz" "enp1s0.202" "enp1s0.204" ]; + interfaces = [ "enp1s0.202" "enp1s0.204" ]; service-sockets-max-retries = 15; service-sockets-retry-wait-time = 2000; }; @@ -164,30 +142,6 @@ } ]; subnet4 = [ - # Heimnetz - { - id = 201; - subnet = "10.152.4.0/24"; - pools = [ - { - pool = "10.152.4.100 - 10.152.4.240"; - } - ]; - option-data = [ - { - name = "routers"; - data = "10.152.4.1"; - } - { - name = "domain-name-servers"; - data = "10.152.0.1"; - } - { - name = "domain-name"; - data = "net.clerie.de"; - } - ]; - } # Gastnetz { id = 202; diff --git a/hosts/carbon/net-heimnetz.nix b/hosts/carbon/net-heimnetz.nix new file mode 100644 index 0000000..60e0bc6 --- /dev/null +++ b/hosts/carbon/net-heimnetz.nix @@ -0,0 +1,66 @@ +{ ... }: + +{ + + ## Heimnetz + networking.vlans."enp1s0.201" = { + id = 201; + interface = "enp1s0"; + }; + networking.bridges."net-heimnetz".interfaces = [ + "enp1s0.201" + "enp2s0" + ]; + networking.interfaces."net-heimnetz".ipv6.addresses = [ + { address = "fe80::1"; prefixLength = 64; } + { address = "fd00:152:152:4::1"; prefixLength = 64; } + { address = "2001:4cd8:100:1337::1"; prefixLength = 64; } # public IPs for local network + ]; + networking.interfaces."net-heimnetz".ipv4.addresses = [ + { address = "10.152.4.1"; prefixLength = 24; } + ]; + + services.radvd.config = '' + interface net-heimnetz { + AdvSendAdvert on; + prefix 2001:4cd8:100:1337::/64 {}; + RDNSS fd00:152:152::1 {}; + DNSSL net.clerie.de {}; + }; + ''; + + services.kea.dhcp4 = { + settings = { + interfaces-config = { + interfaces = [ "net-heimnetz" ]; + }; + subnet4 = [ + # Heimnetz + { + id = 201; + subnet = "10.152.4.0/24"; + pools = [ + { + pool = "10.152.4.100 - 10.152.4.240"; + } + ]; + option-data = [ + { + name = "routers"; + data = "10.152.4.1"; + } + { + name = "domain-name-servers"; + data = "10.152.0.1"; + } + { + name = "domain-name"; + data = "net.clerie.de"; + } + ]; + } + ]; + }; + }; + +}