machines/raven: add dnsmasq with basic config

Co-Authored-By: jalr <mail@jalr.de>
This commit is contained in:
Simon Bruder 2021-07-18 20:55:05 +02:00
parent f63ad2ea39
commit 1a7a2b212a
No known key found for this signature in database
GPG key ID: 8D3C82F9F309F8EC
3 changed files with 47 additions and 1 deletions

View file

@ -3,6 +3,7 @@
{
imports = [
./hardware-configuration.nix
./services
];
networking.hostName = "raven";
@ -29,7 +30,7 @@
labprod.useDHCP = true;
jt.useDHCP = true;
labdev.ipv4.addresses = [{
address = "192.168.0.1";
address = "192.168.94.1";
prefixLength = 24;
}];
};

View file

@ -0,0 +1,5 @@
{
imports = [
./dnsmasq.nix
];
}

View file

@ -0,0 +1,40 @@
{ pkgs, ... }:
{
services.dnsmasq = {
enable = true;
extraConfig = ''
bind-dynamic
expand-hosts
domain=lab.fablab-nea.de
dhcp-range=192.168.94.20,192.168.94.254,5m
dhcp-boot=lpxelinux.0,raven,192.168.94.1
cache-size=10000
dns-forward-max=1000
auth-zone=lab.fablab-nea.de,192.168.94.0/24
auth-server=lab.fablab-nea.de,78.47.224.251
no-hosts
addn-hosts=${pkgs.writeText "hosts.dnsmasq" ''
192.168.94.1 raven labsync
192.168.94.2 switch
''}
'';
servers = [
"142.250.185.78" # dns.as250.net
"2001:470:20::2" # ordns.he.net
"74.82.42.42" # ordns.he.net
];
};
networking.firewall = {
allowedUDPPorts = [ 53 67 ];
allowedTCPPorts = [ 53 ];
};
}