summaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-12-03 03:08:09 +0000
committertv <tv@krebsco.de>2026-12-03 03:08:09 +0000
commit30afe247680660de367253a66d426da5e4884e3f (patch)
tree43027cafce61a4ba751b7c8373374d398788336e /modules
parent4850098ed95ce8b5ce6a2b410786e3b674071523 (diff)
dnsmasq: configure hrm.nftables directly
The forward chain accepts established and related connections itself.
Diffstat (limited to 'modules')
-rw-r--r--modules/dnsmasq.nix27
1 files changed, 14 insertions, 13 deletions
diff --git a/modules/dnsmasq.nix b/modules/dnsmasq.nix
index b12cea38..6cd927c4 100644
--- a/modules/dnsmasq.nix
+++ b/modules/dnsmasq.nix
@@ -37,23 +37,24 @@ in {
dhcp-range=${cfg.dhcp-range}
listen-address=${cfg.address}
'';
- tv.iptables.extra.filter.INPUT = [
- "-i ${cfg.interface} -p tcp -m tcp --dport bootps -j ACCEPT"
- "-i ${cfg.interface} -p udp -m udp --dport bootps -j ACCEPT"
- "-i ${cfg.interface} -p tcp -m tcp --dport domain -j ACCEPT"
- "-i ${cfg.interface} -p udp -m udp --dport domain -j ACCEPT"
- ];
+ hrm.nftables.tables.filter.chains.input.rules.dnsmasq = {
+ order = 1500;
+ iifname = cfg.interface;
+ tcp.dport = [ "bootps" "domain" ];
+ udp.dport = [ "bootps" "domain" ];
+ verdict = "accept";
+ };
}
{
# enable forwarding
boot.kernel.sysctl."net.ipv4.ip_forward" = true;
- tv.iptables.extra.filter.FORWARD = [
- "-m state --state RELATED,ESTABLISHED -j ACCEPT"
- "-i ${cfg.interface} -j ACCEPT"
- ];
- tv.iptables.extra.nat.POSTROUTING = [
- "-j MASQUERADE"
- ];
+ hrm.nftables.tables.filter.chains.forward.rules.dnsmasq = {
+ iifname = cfg.interface;
+ verdict = "accept";
+ };
+ hrm.nftables.tables.nat.chains.postrouting.rules.dnsmasq = {
+ verdict = "masquerade";
+ };
}
]);
[cgit] Unable to lock slot /tmp/cgit/a5100000.lock: Permission denied (13)