forked from DGNum/infrastructure
feat(netconf/dgn-isp): init
module to make isp switches description easier
This commit is contained in:
parent
15cec17611
commit
1ed3749c33
2 changed files with 98 additions and 0 deletions
|
@ -10,5 +10,6 @@
|
|||
./dgn-interfaces.nix
|
||||
./dgn-access-control.nix
|
||||
./dgn-profiles.nix
|
||||
./dgn-isp.nix
|
||||
];
|
||||
}
|
||||
|
|
97
modules/netconf/dgn-isp.nix
Normal file
97
modules/netconf/dgn-isp.nix
Normal file
|
@ -0,0 +1,97 @@
|
|||
# SPDX-FileCopyrightText: 2025 Lubin Bailly <lubin.bailly@dgnum.eu>
|
||||
#
|
||||
# SPDX-License-Identifier: EUPL-1.2
|
||||
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
let
|
||||
inherit (lib)
|
||||
mkEnableOption
|
||||
mkIf
|
||||
mkOption
|
||||
;
|
||||
inherit (lib.types)
|
||||
listOf
|
||||
str
|
||||
;
|
||||
cfg = config.dgn-isp;
|
||||
in
|
||||
{
|
||||
options.dgn-isp = {
|
||||
enable = mkEnableOption "Common isp configuration";
|
||||
|
||||
AP = mkOption {
|
||||
type = listOf str;
|
||||
default = [ ];
|
||||
description = ''
|
||||
Interfaces connected to one of our Access Point.
|
||||
'';
|
||||
};
|
||||
|
||||
staging-AP = mkOption {
|
||||
type = listOf str;
|
||||
default = [ ];
|
||||
description = ''
|
||||
Interfaces connected to one of our Access Point being deployed.
|
||||
'';
|
||||
};
|
||||
|
||||
admin-ip = mkOption {
|
||||
type = str;
|
||||
description = ''
|
||||
Administrative IPv6.
|
||||
'';
|
||||
};
|
||||
};
|
||||
config = mkIf cfg.enable {
|
||||
vlans = {
|
||||
"uplink-cri".id = 223;
|
||||
|
||||
"admin-core" = {
|
||||
id = 3000;
|
||||
l3-interface = "irb.0";
|
||||
};
|
||||
"admin-ap".id = 3001;
|
||||
"users".id-list = [
|
||||
{
|
||||
begin = 3045;
|
||||
end = 4094;
|
||||
}
|
||||
];
|
||||
|
||||
"ap-staging".id = 2000;
|
||||
"hypervisor".id = 2001;
|
||||
};
|
||||
|
||||
dgn-interfaces."irb".inet6.addresses = [ cfg.admin-ip ];
|
||||
|
||||
dgn-profiles = {
|
||||
AP = {
|
||||
interfaces = cfg.AP;
|
||||
configuration = {
|
||||
poe = true;
|
||||
ethernet-switching = {
|
||||
interface-mode = "trunk";
|
||||
vlans = [
|
||||
"users"
|
||||
"admin-ap"
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
staging-AP = {
|
||||
interfaces = cfg.staging-AP;
|
||||
configuration = {
|
||||
poe = true;
|
||||
ethernet-switching = {
|
||||
interface-mode = "access";
|
||||
vlans = [ "ap-staging" ];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Reference in a new issue