diff options
author | Gregor Kleen <gkleen@yggdrasil.li> | 2022-03-03 18:00:26 +0100 |
---|---|---|
committer | Gregor Kleen <gkleen@yggdrasil.li> | 2022-03-03 18:00:26 +0100 |
commit | be085a5185bfd25d570a7202675fe7ee82fd5b41 (patch) | |
tree | 7bdc09af8f812ca971bbe96f60cb711bc278227e /hosts/vidhar | |
parent | c9e147c93b8bd3c52b2e7658d928daec6bd824e1 (diff) | |
download | nixos-be085a5185bfd25d570a7202675fe7ee82fd5b41.tar nixos-be085a5185bfd25d570a7202675fe7ee82fd5b41.tar.gz nixos-be085a5185bfd25d570a7202675fe7ee82fd5b41.tar.bz2 nixos-be085a5185bfd25d570a7202675fe7ee82fd5b41.tar.xz nixos-be085a5185bfd25d570a7202675fe7ee82fd5b41.zip |
vidhar: kea-dhcp4
Diffstat (limited to 'hosts/vidhar')
-rw-r--r-- | hosts/vidhar/network/default.nix | 116 |
1 files changed, 76 insertions, 40 deletions
diff --git a/hosts/vidhar/network/default.nix b/hosts/vidhar/network/default.nix index e8c5ba9c..1511c4c7 100644 --- a/hosts/vidhar/network/default.nix +++ b/hosts/vidhar/network/default.nix | |||
@@ -53,49 +53,85 @@ | |||
53 | llmnr = "false"; | 53 | llmnr = "false"; |
54 | }; | 54 | }; |
55 | 55 | ||
56 | services.dhcpd4 = { | 56 | services.kea = { |
57 | enable = true; | 57 | dhcp4 = { |
58 | interfaces = [ "lan" "mgmt" ]; | 58 | enable = true; |
59 | extraConfig = '' | 59 | settings = { |
60 | subnet 10.141.0.0 netmask 255.255.255.0 { | 60 | valid-lifetime = 4000; |
61 | range 10.141.0.128 10.141.0.254; | 61 | rebind-timer = 2000; |
62 | option domain-name-servers 10.141.0.1; | 62 | renew-timer = 1000; |
63 | option broadcast-address 10.141.0.255; | 63 | |
64 | option routers 10.141.0.1; | 64 | interfaces-config = { |
65 | option domain-name "yggdrasil"; | 65 | interfaces = [ "lan" "mgmt" ]; |
66 | } | 66 | }; |
67 | 67 | ||
68 | subnet 10.141.1.0 netmask 255.255.255.0 { | 68 | lease-database = { |
69 | range 10.141.1.128 10.141.1.254; | 69 | name = "/var/lib/kea/dhcp4.leases"; |
70 | option domain-name-servers 10.141.1.1; | 70 | persist = true; |
71 | option broadcast-address 10.141.1.255; | 71 | type = "memfile"; |
72 | } | 72 | }; |
73 | 73 | ||
74 | subnet 10.141.2.0 netmask 255.255.255.0 { | 74 | subnet4 = [ |
75 | range 10.141.2.128 10.141.2.254; | 75 | { subnet = "10.141.0.0/24"; |
76 | option domain-name-servers 10.141.2.1; | 76 | option-data = [ |
77 | option broadcast-address 10.141.2.255; | 77 | { name = "domain-name-servers"; |
78 | option routers 10.141.2.1; | 78 | data = "10.141.0.1"; |
79 | } | 79 | } |
80 | ''; | 80 | { name = "broadcast-address"; |
81 | machines = [ | 81 | data = "10.141.0.255"; |
82 | { | 82 | } |
83 | ethernetAddress = "50:d4:f7:f3:0f:7e"; | 83 | { name = "routers"; |
84 | hostName = "gauss-ap01"; | 84 | data = "10.141.0.1"; |
85 | ipAddress = "10.141.0.64"; | 85 | } |
86 | } | 86 | { name = "domain-name"; |
87 | { | 87 | data = "yggdrasil"; |
88 | ethernetAddress = "60:a4:b7:53:94:b5"; | 88 | } |
89 | hostName = "switch01"; | 89 | ]; |
90 | ipAddress = "10.141.1.2"; | 90 | pools = [ { pool = "10.141.0.128 - 10.141.0.254"; } ]; |
91 | } | 91 | reservations = []; |
92 | { | 92 | } |
93 | ethernetAddress = "74:ac:b9:29:ad:9a"; | 93 | { subnet = "10.141.1.0/24"; |
94 | hostName = "ap01"; | 94 | option-data = [ |
95 | ipAddress = "10.141.1.4"; | 95 | { name = "domain-name-servers"; |
96 | } | 96 | data = "10.141.1.1"; |
97 | ]; | 97 | } |
98 | { name = "broadcast-address"; | ||
99 | data = "10.141.1.255"; | ||
100 | } | ||
101 | ]; | ||
102 | pools = [ { pool = "10.141.1.128 - 10.141.1.254"; } ]; | ||
103 | reservations = [ | ||
104 | { hostname = "switch01"; | ||
105 | hw-address = "60:a4:b7:53:94:b5"; | ||
106 | ip-address = "10.141.1.2"; | ||
107 | } | ||
108 | ]; | ||
109 | } | ||
110 | { subnet = "10.141.2.0/24"; | ||
111 | option-data = [ | ||
112 | { name = "domain-name-servers"; | ||
113 | data = "10.141.2.1"; | ||
114 | } | ||
115 | { name = "broadcast-address"; | ||
116 | data = "10.141.2.255"; | ||
117 | } | ||
118 | { name = "routers"; | ||
119 | data = "10.141.2.1"; | ||
120 | } | ||
121 | ]; | ||
122 | pools = [ { pool = "10.141.2.128 - 10.141.2.254"; } ]; | ||
123 | reservations = [ | ||
124 | { hostname = "ap01"; | ||
125 | hw-address = "74:ac:b9:29:ad:9a"; | ||
126 | ip-address = "10.141.1.4"; | ||
127 | } | ||
128 | ]; | ||
129 | } | ||
130 | ]; | ||
131 | }; | ||
132 | }; | ||
98 | }; | 133 | }; |
134 | |||
99 | systemd.network.networks = { | 135 | systemd.network.networks = { |
100 | "eno1" = { | 136 | "eno1" = { |
101 | matchConfig.Name = "eno1"; | 137 | matchConfig.Name = "eno1"; |