configure resolv-dns for public user network

This commit is contained in:
lilly 2025-03-14 20:36:15 +01:00
commit ac06f51765
Signed by: lilly
SSH key fingerprint: SHA256:y9T5GFw2A20WVklhetIxG1+kcg/Ce0shnQmbu1LQ37g
2 changed files with 30 additions and 1 deletions

View file

@ -3,6 +3,17 @@
lib, lib,
... ...
}: }:
let
renameLink = macAddr: newName: {
matchConfig = {
MACAddress = macAddr;
Type = "ether";
};
linkConfig = {
Name = newName;
};
};
in
{ {
imports = [ ]; imports = [ ];
@ -10,15 +21,31 @@
networking.useDHCP = false; networking.useDHCP = false;
systemd.network = { systemd.network = {
enable = true; enable = true;
links = {
"10-ethMgmt" = renameLink "BC:24:11:61:E3:D9" "ethMgmt";
"10-ethPubUser" = renameLink "BC:24:11:AD:52:B1" "ethPubUsr";
};
networks = { networks = {
"10-mgmtNet" = { "10-mgmtNet" = {
matchConfig.MACAddress = "BC:24:11:61:E3:D9"; matchConfig.Name = "ethMgmt";
address = [ "10.20.25.5/24" ]; address = [ "10.20.25.5/24" ];
gateway = [ "10.20.25.2" ]; gateway = [ "10.20.25.2" ];
}; };
"10-pubUsr" = {
matchConfig.Name = "ethPubUsr";
address = [ "10.0.0.2/24" ];
gateway = [ "10.0.0.1" ];
};
}; };
}; };
# configure remaining network to work
services.resolved.enable = false;
networking.firewall = {
allowedTCPPorts = [ 53 ];
allowedUDPPorts = [ 53 ];
};
# enable knot resolv server # enable knot resolv server
# ref: https://search.nüschtos.de/?query=services.kresd # ref: https://search.nüschtos.de/?query=services.kresd
# https://www.knot-resolver.cz/documentation/stable/ # https://www.knot-resolver.cz/documentation/stable/

View file

@ -76,6 +76,7 @@ in
authoritative = true; authoritative = true;
shared-networks = [ shared-networks = [
{ {
# management network
name = "mgmtNet"; name = "mgmtNet";
interface = "ethMgmt"; interface = "ethMgmt";
option-data = [ option-data = [
@ -102,6 +103,7 @@ in
} }
{ {
# public user network (only temporary setup)
name = "tempPublicUser"; name = "tempPublicUser";
interface = "ethPubUsr"; interface = "ethPubUsr";
option-data = [ option-data = [