blob: fb22afb43e8bb6f5887dc00df498940a981363ae (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
|
{ pkgs, config, ... }: {
networking.nameservers = [ "192.168.77.2" ];
# Router container
containers.dnsdhcp = {
autoStart = true;
ephemeral = true;
privateNetwork = true;
hostBridge = "br-lan1";
#hostBridge = "br-lan1";
#localMacAddress = "02:00:00:00:77:01";
config = { lib, config, ... }: {
imports = [
../../nixos/services/router
#./router-hosts.nix # Contains dhcp config + static leases + overrides
./dns-overrides.nix
];
# Network
networking = {
enableIPv6 = false;
defaultGateway = "192.168.77.1";
interfaces.eth0.ipv4.addresses = [{
address = "192.168.77.2";
prefixLength = 24;
}];
firewall = {
# DNS+DHCP ports
allowedTCPPorts = [ 53 ];
allowedUDPPorts = [ 53 67 ];
};
};
# Setup dns server
services._router = {
dnsDhcpConfig = {
enable = true;
#localResolution = {
# localDomain = "pls.lan";
# localDnsAddress = "192.168.77.1@53";
# localReverseZone = "77.168.192.in-addr.arpa";
#};
};
routing.enable = false;
};
services.unbound._blocklists = {
enable = true;
hageziBlocklists = [ "pro" "nsfw" ];
};
system.stateVersion = "26.05";
};
};
}
|