configure resolv-dns for public user network

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

View file

@ -3,6 +3,17 @@
lib,
...
}:
let
renameLink = macAddr: newName: {
matchConfig = {
MACAddress = macAddr;
Type = "ether";
};
linkConfig = {
Name = newName;
};
};
in
{
imports = [ ];
@ -10,15 +21,31 @@
networking.useDHCP = false;
systemd.network = {
enable = true;
links = {
"10-ethMgmt" = renameLink "BC:24:11:61:E3:D9" "ethMgmt";
"10-ethPubUser" = renameLink "BC:24:11:AD:52:B1" "ethPubUsr";
};
networks = {
"10-mgmtNet" = {
matchConfig.MACAddress = "BC:24:11:61:E3:D9";
matchConfig.Name = "ethMgmt";
address = [ "10.20.25.5/24" ];
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
# ref: https://search.nüschtos.de/?query=services.kresd
# https://www.knot-resolver.cz/documentation/stable/

View file

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