changement dans le plan IP et free-radius DHCP #99

Merged
thubrecht merged 9 commits from lbailly/infrastructure:plan_ip into main 2024-05-26 20:57:19 +02:00
Showing only changes of commit 150e741263 - Show all commits

View file

@ -47,15 +47,35 @@ let
name = "vlan-user-${builtins.toString vlan}";
value = {
Id = vlan;
extraNetwork.routes = [
address = [ ];
extraNetwork = {
addresses = [
{
routeConfig = {
Destination = "10.0.${builtins.toString prefix24nb}.${builtins.toString prefix27nb}/27";
Source = "10.0.0.1/17";
addressConfig = {
Address = "10.0.${builtins.toString prefix24nb}.${builtins.toString (prefix27nb + 1)}/27";
AddPrefixRoute = false;
};
}
];
address = [ "10.0.0.1/17" ];
routes = [
{
routeConfig = {
Destination = "10.0.${builtins.toString prefix24nb}.${builtins.toString prefix27nb}/27";
Table = "user";
};
}
];
routingPolicyRules = [
{
routingPolicyRuleConfig = {
From = "10.0.${builtins.toString prefix24nb}.${builtins.toString prefix27nb}/27";
To = "10.0.0.0/27";
IncomingInterface = "vlan-user-${builtins.toString vlan}";
Table = "user";
};
}
];
};
};
};
@ -91,12 +111,37 @@ let
extraNetwork.networkConfig.DHCPServer = "yes";
};
} // builtins.listToAttrs (builtins.genList mkUserVlan 300); # 850 when we can
} // builtins.listToAttrs (builtins.genList mkUserVlan 10); # 850 when we can
in
{
systemd.network = {
config.routeTables."user" = 1000;
networks = {
"10-lo" = {
name = "lo";
address = [
"::1/128"
"127.0.0.1/8"
"10.0.0.1/16"
];
routes = [
{
routeConfig = {
Destination = "10.0.0.0/27";
Table = "user";
};
}
];
routingPolicyRules = [
{
routingPolicyRuleConfig = {
IncomingInterface = "lo";
Table = "user";
};
}
];
};
"10-enp67s0f0np0" = {
name = "enp67s0f0np0";
networkConfig = {