nixos: Production network configuration

This commit is contained in:
Jack O'Sullivan 2022-07-01 01:02:55 +01:00
parent a92358f28b
commit 4fd6330274
3 changed files with 22 additions and 16 deletions

View File

@ -181,7 +181,7 @@ rec {
start = { start = {
all = { all = {
v4 = "10.100."; v4 = "10.100.";
v6 = "2a0e:97c0:4d0:ccc"; v6 = "2a0e:97c0:4d1:1";
}; };
base = { base = {
v4 = "${start.all.v4}0."; v4 = "${start.all.v4}0.";

View File

@ -10,13 +10,16 @@
altNames = [ "fw" ]; altNames = [ "fw" ];
domain = lib.my.colony.domain; domain = lib.my.colony.domain;
ipv4 = { ipv4 = {
address = "188.141.14.136"; address = "212.83.51.97";
gateway = null; mask = 24;
gateway = "212.83.51.1";
genPTR = false; genPTR = false;
}; };
ipv6 = { ipv6 = {
address = "2a0e:97c0:4d0:cccf::1"; address = "2a00:f48:103:2::10";
gateway = "fe80::215:17ff:fe4b:494a"; mask = 64;
gateway = "2a00:f48:103:2::1";
genPTR = false;
}; };
}; };
base = { base = {
@ -71,10 +74,15 @@
systemd.network = { systemd.network = {
links = { links = {
"10-wan" = { "10-phy1g0" = {
matchConfig.MACAddress = "d0:50:99:fa:a7:99"; matchConfig.MACAddress = "d0:50:99:fa:a7:99";
linkConfig.Name = "phy1g0";
};
"10-wan" = {
matchConfig.MACAddress = "00:02:c9:56:24:6e";
linkConfig.Name = "wan"; linkConfig.Name = "wan";
}; };
"10-base" = { "10-base" = {
matchConfig.MACAddress = "52:54:00:15:1a:53"; matchConfig.MACAddress = "52:54:00:15:1a:53";
linkConfig.Name = "base"; linkConfig.Name = "base";
@ -84,16 +92,14 @@
networks = { networks = {
"80-wan" = { "80-wan" = {
matchConfig.Name = "wan"; matchConfig.Name = "wan";
DHCP = "ipv4"; DHCP = "no";
dhcpV4Config = { address = with assignments.internal; [
UseDNS = false; (with ipv4; "${address}/${toString mask}")
UseHostname = false; (with ipv6; "${address}/${toString mask}")
};
address = [
(with assignments.internal.ipv6; "${address}/${toString mask}")
]; ];
gateway = [ gateway = with assignments.internal; [
assignments.internal.ipv6.gateway ipv4.gateway
ipv6.gateway
]; ];
networkConfig.IPv6AcceptRA = false; networkConfig.IPv6AcceptRA = false;
}; };

View File

@ -7,7 +7,7 @@ let
ptrDots = 2; ptrDots = 2;
reverseZone = "100.10.in-addr.arpa"; reverseZone = "100.10.in-addr.arpa";
ptrDots6 = 17; ptrDots6 = 17;
reverseZone6 = "c.c.c.0.d.4.0.0.c.7.9.e.0.a.2.ip6.arpa"; reverseZone6 = "1.0.0.1.d.4.0.0.c.7.9.e.0.a.2.ip6.arpa";
authZones = attrNames config.my.pdns.auth.bind.zones; authZones = attrNames config.my.pdns.auth.bind.zones;
in in