feat(nftables): lan rules

This commit is contained in:
arcnmx 2024-01-24 12:59:28 -08:00
parent 59c61d021e
commit c321f3a502
6 changed files with 64 additions and 19 deletions

View file

@ -6,6 +6,7 @@
inherit (lib.modules) mkIf mkMerge mkDefault mkOptionDefault;
inherit (lib.options) mkOption;
inherit (lib.lists) optionals;
inherit (lib.strings) concatStringsSep;
inherit (config.services) tailscale avahi;
inherit (config) networking;
inherit (networking) hostName;
@ -83,4 +84,15 @@ in {
};
};
};
config.networking.firewall = {
interfaces.local = {
nftables.conditions = [
"ip saddr { ${concatStringsSep ", " networking.access.cidrForNetwork.local.v4} }"
(mkIf networking.enableIPv6
"ip6 saddr { ${concatStringsSep ", " networking.access.cidrForNetwork.local.v6} }"
)
];
};
};
}