summaryrefslogtreecommitdiffstats
path: root/systems
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-12-03 03:08:37 +0000
committertv <tv@krebsco.de>2026-12-03 03:28:07 +0000
commit0329cbde6fe7105ca6e620be421fb4b888ae2029 (patch)
tree5698e1593ce12c864eb2f5ad99abd72837ed076c /systems
parent967723e28917ec975d5879b40c602ee959ae61d1 (diff)
ne: configure hrm.nftables directly
Diffstat (limited to 'systems')
-rw-r--r--systems/ne/config.nix57
1 files changed, 38 insertions, 19 deletions
diff --git a/systems/ne/config.nix b/systems/ne/config.nix
index 755a90fc..128683d3 100644
--- a/systems/ne/config.nix
+++ b/systems/ne/config.nix
@@ -82,14 +82,18 @@
prefixLength = config.krebs.build.host.nets.internet.ip6.prefixLength;
}
];
- tv.iptables.extra6.filter.INPUT = [
- # Allow Neighbor Discovery
- # https://en.wikipedia.org/wiki/Neighbor_Discovery_Protocol
- "-p icmpv6 --icmpv6-type 133 -j ACCEPT"
- "-p icmpv6 --icmpv6-type 134 -j ACCEPT"
- "-p icmpv6 --icmpv6-type 135 -j ACCEPT"
- "-p icmpv6 --icmpv6-type 136 -j ACCEPT"
- ];
+ # Allow Neighbor Discovery
+ # https://en.wikipedia.org/wiki/Neighbor_Discovery_Protocol
+ hrm.nftables.tables.filter.chains.input.rules.neighbor-discovery-all = {
+ order = 1500;
+ icmpv6.type = [
+ "nd-router-solicit"
+ "nd-router-advert"
+ "nd-neighbor-solicit"
+ "nd-neighbor-advert"
+ ];
+ verdict = "accept";
+ };
})
# wiregrill configuration
@@ -99,16 +103,31 @@
imports = [
../../configs/wiregrill.nix
];
- tv.iptables.extra4.nat.POSTROUTING = [ "-s 10.244.3.0/24 ! -d 10.244.3.0/24 -j MASQUERADE" ];
- tv.iptables.extra6.nat.POSTROUTING = [ "-s 42:1::/32 ! -d 42:1::/32 -j MASQUERADE" ];
- tv.iptables.extra6.filter.FORWARD = [
- "-s ${config.krebs.hosts.pi.nets.wiregrill.ip6.addr} -j ACCEPT"
- "-s 42:1:a46e::/48 -j ACCEPT" # tv
- ];
- tv.iptables.extra4.filter.FORWARD = [
- "-i wiregrill -o retiolum -j ACCEPT"
- "-i retiolum -o wiregrill -j ACCEPT"
- ];
+ hrm.nftables.tables.nat.chains.postrouting.rules = {
+ wiregrill-masquerade-ipv4.text =
+ "ip saddr 10.244.3.0/24 ip daddr != 10.244.3.0/24 masquerade";
+ wiregrill-masquerade-ipv6.text =
+ "ip6 saddr 42:1::/32 ip6 daddr != 42:1::/32 masquerade";
+ };
+ hrm.nftables.tables.filter.chains.forward.rules = {
+ wiregrill-out = {
+ saddr = [
+ config.krebs.hosts.pi.nets.wiregrill.ip6.addr
+ "42:1:a46e::/48" # tv
+ ];
+ verdict = "accept";
+ };
+ wiregrill-to-retiolum = {
+ iifname = "wiregrill";
+ oifname = "retiolum";
+ verdict = "accept";
+ };
+ retiolum-to-wiregrill = {
+ iifname = "retiolum";
+ oifname = "wiregrill";
+ verdict = "accept";
+ };
+ };
})
# Nginx configuration
@@ -130,7 +149,7 @@
add_header Strict-Transport-Security 'max-age=31536000; includeSubDomains; preload' always;
'';
- tv.iptables.input-internet-accept-tcp = [
+ hrm.nftables.input.internet.tcp = [
"http"
"https"
];
[cgit] Unable to lock slot /tmp/cgit/e1100000.lock: Permission denied (13)