Improve firewalling

This commit is contained in:
Jakob Lechner 2024-05-04 14:50:59 +00:00
parent b395cde724
commit 0042b62652
4 changed files with 32 additions and 14 deletions

View file

@ -1,4 +1,4 @@
{ pkgs, ... }:
{ lib, pkgs, ... }:
let
stateDir = "/var/lib/dnsmasq";
@ -42,8 +42,18 @@ in
};
};
networking.firewall = {
allowedUDPPorts = [ 53 67 ];
allowedTCPPorts = [ 53 ];
};
networking.firewall.interfaces = lib.attrsets.genAttrs [
"heizung"
"iot"
"lechner"
"pv"
"sprechanlage"
"voice"
]
(
interface: {
allowedUDPPorts = [ 53 67 ];
allowedTCPPorts = [ 53 ];
}
);
}

View file

@ -6,8 +6,9 @@ in
{
services.unifi = {
enable = true;
openFirewall = true;
unifiPackage = pkgs.unifi;
};
networking.firewall.allowedTCPPorts = [ ports.unifi.tcp ];
networking.firewall.interfaces.lechner.allowedTCPPorts = [
ports.unifi.tcp
];
}

View file

@ -1,4 +1,4 @@
{ pkgs, ... }:
{ lib, pkgs, ... }:
let
stateDir = "/var/lib/dnsmasq";
@ -37,8 +37,14 @@ in
};
};
networking.firewall = {
allowedUDPPorts = [ 53 67 ];
allowedTCPPorts = [ 53 ];
};
networking.firewall.interfaces = lib.attrsets.genAttrs [
"enp2s4"
"iot"
]
(
interface: {
allowedUDPPorts = [ 53 67 ];
allowedTCPPorts = [ 53 ];
}
);
}

View file

@ -6,8 +6,9 @@ in
{
services.unifi = {
enable = true;
openFirewall = true;
unifiPackage = pkgs.unifi;
};
networking.firewall.allowedTCPPorts = [ ports.unifi.tcp ];
networking.firewall.interfaces.enp2s4.allowedTCPPorts = [
ports.unifi.tcp
];
}