feat(vault01): Add user vlans

Only the first 300 vlans are activated, 850 make it crash
This commit is contained in:
catvayor 2024-04-15 09:34:13 +02:00 committed by thubrecht
parent 9e75839ada
commit 01c2505491

View file

@ -35,6 +35,21 @@ let
vlanConfig.Id = Id;
};
mkUserVlan =
id:
let
vlan = 3245 + id;
prefix24nb = id / 32;
prefix29nb = (id - prefix24nb * 32) * 8;
in
{
name = "vlan-user-${builtins.toString vlan}";
value = {
Id = vlan;
address = [ "10.0.${builtins.toString prefix24nb}.${builtins.toString (prefix29nb + 1)}/29" ];
};
};
vlans = {
vlan-uplink-cri = {
Id = 223;
@ -67,7 +82,7 @@ let
extraNetwork.networkConfig.DHCPServer = "yes";
};
};
} // builtins.listToAttrs (builtins.genList mkUserVlan 300); # 850 when we can
in
{