summaryrefslogtreecommitdiff
path: root/config/networking/services/dhcp.nix
diff options
context:
space:
mode:
Diffstat (limited to 'config/networking/services/dhcp.nix')
-rw-r--r--config/networking/services/dhcp.nix24
1 files changed, 16 insertions, 8 deletions
diff --git a/config/networking/services/dhcp.nix b/config/networking/services/dhcp.nix
index f4b1f61..9953389 100644
--- a/config/networking/services/dhcp.nix
+++ b/config/networking/services/dhcp.nix
@@ -4,15 +4,23 @@ let cfg = config.personal.networking;
in {
services.dhcpd4 = {
enable = true;
- extraConfig = ''
- option subnet-mask 255.255.255.0;
- option routers ${cfg.subnets.private}.1;
- option domain-name-servers ${cfg.subnets.public}.1, 9.9.9.9;
- subnet ${cfg.subnets.private}.0 netmask 255.255.255.0 {
- range ${cfg.subnets.private}.10 ${cfg.subnets.private}.99;
+ interfaces = with cfg.interfaces; [ wlp2ghz wlp5ghz ];
+ extraConfig = with cfg.subnets; ''
+ option domain-name-servers ${public}.1, 9.9.9.9;
+ subnet ${private}.0 netmask 255.255.255.0 {
+ option broadcast-address ${private}.255;
+ option routers ${private}.1;
+ option subnet-mask 255.255.255.0;
+ interface ${cfg.interfaces.wlp5ghz};
+ range ${private}.10 ${private}.99;
+ }
+ subnet ${iot}.0 netmask 255.255.255.0 {
+ option broadcast-address ${iot}.255;
+ option routers ${iot}.1;
+ option subnet-mask 255.255.255.0;
+ interface ${cfg.interfaces.wlp2ghz};
+ range ${iot}.10 ${iot}.99
}
'';
- interfaces = [ cfg.interfaces.wlp5ghz ];
};
-
}