add mgmt nft
This commit is contained in:
parent
a4fd96a197
commit
1ff6293bec
4 changed files with 106 additions and 4 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue