add mgmt nft

This commit is contained in:
asyncnomi 2025-07-21 21:09:45 +02:00
parent a4fd96a197
commit 1ff6293bec
4 changed files with 106 additions and 4 deletions

View file

@ -15,6 +15,20 @@ let
# And routes, the gateway is assumed to be in subnet, otherwise GatewayOnLink is required
route4 = if supportsIPv4 myNode then [{ Gateway = myNode.gIp4; }] else [];
route6 = if supportsIPv6 myNode then [{ Gateway = myNode.gIp6; }] else [];
# Return route for mgmt traffic
rtwg4 = if myNode.id == 1 then [] else
map (node: {
Gateway = "172.19.${toString node.zone}.1";
Destination = "172.19.${toString (node.zone + 127)}.0/24";
}) (lib.attrValues (lib.filterAttrs (name: node: node.id == 1) nodes));
rtwg6 = if myNode.id == 1 then [] else
map (node: {
Gateway = "fc00::${toString node.zone}:1";
Destination = "fc00:f::${toString (node.zone + 127)}:0/96";
}) (lib.attrValues (lib.filterAttrs (name: node: node.id == 1) nodes));
in
{
networking.hostName = config.hostName;