40 lines
835 B
Nix
40 lines
835 B
Nix
|
{ config, lib, ... }:
|
||
|
{
|
||
|
options = {
|
||
|
mainInterface = lib.mkOption {
|
||
|
type = lib.types.str;
|
||
|
};
|
||
|
};
|
||
|
config = {
|
||
|
networking.firewall.allowedUDPPorts = [
|
||
|
67
|
||
|
68
|
||
|
];
|
||
|
systemd.network.networks.${config.mainInterface} = {
|
||
|
networkConfig = {
|
||
|
DHCPServer = true;
|
||
|
IPv6SendRA = true;
|
||
|
};
|
||
|
dhcpServerConfig = {
|
||
|
EmitDNS = true;
|
||
|
PoolSize = 50;
|
||
|
DNS = [
|
||
|
"10.42.69.2"
|
||
|
"10.42.69.100"
|
||
|
];
|
||
|
EmitRouter = true;
|
||
|
Router = "10.42.69.1";
|
||
|
SendOption = [
|
||
|
"15:string:icanttype.org"
|
||
|
"119:string:icanttype.org"
|
||
|
];
|
||
|
};
|
||
|
ipv6SendRAConfig = {
|
||
|
RouterLifetimeSec = 0;
|
||
|
EmitDNS = false;
|
||
|
};
|
||
|
ipv6Prefixes = [ { Prefix = "fd72:3dd5:21ae:3c97::/64"; } ];
|
||
|
};
|
||
|
};
|
||
|
}
|