From 1dcfe98b679c168fc16619486fc1dc7b41f0cf26 Mon Sep 17 00:00:00 2001 From: Greg Hellings Date: Sat, 18 Mar 2023 20:11:52 -0500 Subject: [PATCH] Add ICDM dns entries --- hosts/icdm-root/networking.nix | 40 +++++++++++++++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) diff --git a/hosts/icdm-root/networking.nix b/hosts/icdm-root/networking.nix index 8f11a2d..5a0b28c 100644 --- a/hosts/icdm-root/networking.nix +++ b/hosts/icdm-root/networking.nix @@ -1,5 +1,9 @@ {...}: - +let + dnsHosts = builtins.concatStringsSep "\n" [ + "wiki.icdm.lan 10.42.101.1" + ]; +in { # If we have to do proxying in Bayonnais, we can start to work on that here # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain"; @@ -14,7 +18,41 @@ eno1.ipv4.addresses = [ { address = "10.42.101.1"; prefixLength = 16; + } { + address = "10.77.1.2"; + prefixLength = 16; } ]; }; + # Allow traffic through + firewall = { + enable = true; + allowedTCPPorts = [ 53 ]; + allowedUDPPorts = [ 53 67 ]; + }; + + extraHosts = "${dns_hosts}"; + }; + + services.dnsmasq = { + enable = true; + settings = { + domain = "icdm.lan"; + dhcp-range = [ + "eno1,10.77.1.10,10.77.1.255,255.255.0.0,12h" + ]; + dhcp-option = [ + "eno1,option:router,10.77.1.1" + "eno1,option:dns-server,10.77.1.2,1.1.1.1" + "eno1,option:domain-search,icdm.lan" + ]; + expand-hosts = true; + log-dhcp = true; + log-queries = true; + # Upstream servers + server = [ + "1.1.1.1" + "8.8.4.4" + ]; + }; }; }