nixos/home: Keep untrusted to the Internet

The routers reject new connections from the `untrusted` VLAN to
internal destinations before the firewall's ICMP rules, then allow
Internet transit via `wan` and `as211024`. The shared
`lib.my.c.internalNets` also covers the modem's management subnet.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-18 22:01:54 +00:00
co-authored by Claude Opus 5.5
parent 89cc4b679c
commit 5fb8e8d280
5 changed files with 56 additions and 27 deletions
+16
View File
@@ -464,6 +464,22 @@ rec {
'';
};
# Non-public destinations, plus our own IPv6 prefixes (trusted across the mesh), for keeping
# untrusted workloads to the Internet
internalNets = rec {
v4 = [
"0.0.0.0/8" "10.0.0.0/8" "100.64.0.0/10" "127.0.0.0/8" "169.254.0.0/16"
"172.16.0.0/12" "192.168.0.0/16" "224.0.0.0/4" "240.0.0.0/4"
];
v6 = [
"::/127" "::ffff:0:0/96" "fc00::/7" "fe80::/10" "ff00::/8"
] ++ map (p: colony.prefixes.${p}.v6) [ "home" "all" "cust" "as211024" ];
nftReject = ''
ip daddr { ${concatStringsSep ", " v4} } reject with icmpx admin-prohibited
ip6 daddr { ${concatStringsSep ", " v6} } reject with icmpx admin-prohibited
'';
};
kelder = {
groups = {
storage = 2000;