feat(ap): Separate 2.4G and 5G SSIDs and set correct channels
All checks were successful
Run pre-commit on all files / pre-commit (push) Successful in 23s
All checks were successful
Run pre-commit on all files / pre-commit (push) Successful in 23s
This commit is contained in:
parent
0c3062a5c5
commit
f4fe820944
3 changed files with 60 additions and 8 deletions
|
@ -28,5 +28,6 @@ in
|
|||
defaultProfile.packages = with pkgs; [
|
||||
zyxel-bootconfig
|
||||
min-collect-garbage
|
||||
hostapd-radius
|
||||
];
|
||||
}
|
||||
|
|
|
@ -12,23 +12,32 @@
|
|||
let
|
||||
svc = config.system.service;
|
||||
|
||||
inherit (nodeMeta.extraNodeSettings) building floor ap-no;
|
||||
inherit (nodeMeta.extraNodeSettings)
|
||||
building
|
||||
floor
|
||||
ap-no
|
||||
real-ap-no
|
||||
;
|
||||
|
||||
hex = x: lib.fixedWidthString 2 "0" (lib.toHexString x);
|
||||
|
||||
mac-1 = "02:5B:6A:${hex (building * 4)}:${hex floor}:${hex ap-no}";
|
||||
mac-2 = "02:5B:6A:${hex (building * 4 + 1)}:${hex floor}:${hex ap-no}";
|
||||
|
||||
channel-1 = builtins.elemAt [ 1 6 11 ] (lib.mod (real-ap-no + floor) 3);
|
||||
|
||||
channel-2 = builtins.elemAt [ 36 52 100 ] (lib.mod (real-ap-no + floor) 3);
|
||||
|
||||
secrets-1 = {
|
||||
ssid = "DGNum";
|
||||
};
|
||||
secrets-2 = {
|
||||
ssid = "DGNum";
|
||||
ssid = "DGNum 5G";
|
||||
};
|
||||
baseParams = {
|
||||
country_code = "FR";
|
||||
hw_mode = "g";
|
||||
channel = 6;
|
||||
channel = channel-1;
|
||||
wmm_enabled = 1;
|
||||
ieee80211n = 1;
|
||||
ht_capab = "[LDPC][GF][HT40-][HT40+][SHORT-GI-40][MAX-AMSDU-7935][TX-STBC]";
|
||||
|
@ -56,9 +65,9 @@ let
|
|||
vht_capab = "[MAX-MPDU-7991][SU-BEAMFORMEE][SU-BEAMFORMER][RXLDPC][SHORT-GI-80][MAX-A-MPDU-LEN-EXP3][RX-ANTENNA-PATTERN][TX-ANTENNA-PATTERN][TX-STBC-2BY1][RX-STBC-1][MU-BEAMFORMER]";
|
||||
vht_oper_chwidth = 1;
|
||||
he_oper_chwidth = 1;
|
||||
channel = 36; # TODO understand interferences
|
||||
vht_oper_centr_freq_seg0_idx = 42;
|
||||
he_oper_centr_freq_seg0_idx = 42;
|
||||
channel = channel-2; # TODO understand interferences
|
||||
vht_oper_centr_freq_seg0_idx = channel-2 + 6;
|
||||
he_oper_centr_freq_seg0_idx = channel-2 + 6;
|
||||
require_vht = 1;
|
||||
};
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ let
|
|||
nix-lib = import ../../lib/nix-lib;
|
||||
inherit (nix-lib) mapFuse;
|
||||
|
||||
mkAP' = building: floor: ap-no: {
|
||||
mkAP' = permutations: building: floor: ap-no: {
|
||||
"ap-v01-${builtins.toString building}-${builtins.toString floor}-${builtins.toString ap-no}" = {
|
||||
site = "unknown";
|
||||
adminGroups = [ "fai" ];
|
||||
|
@ -34,6 +34,7 @@ let
|
|||
|
||||
extraNodeSettings = {
|
||||
inherit building floor ap-no;
|
||||
real-ap-no = (builtins.elemAt (builtins.elemAt permutations floor) (ap-no - 1)) - 1;
|
||||
vendor-mac = null;
|
||||
};
|
||||
};
|
||||
|
@ -55,8 +56,9 @@ let
|
|||
building-no,
|
||||
floors,
|
||||
ap-nos,
|
||||
permutations,
|
||||
}:
|
||||
mapFuse (f: mapFuse (mkAP' building-no f) (mkRange ap-nos)) (mkRange floors);
|
||||
mapFuse (f: mapFuse (mkAP' permutations building-no f) (mkRange ap-nos)) (mkRange floors);
|
||||
|
||||
APs = {
|
||||
hypnos-1 = {
|
||||
|
@ -69,6 +71,32 @@ let
|
|||
from = 1;
|
||||
to = 7;
|
||||
};
|
||||
permutations = [
|
||||
[
|
||||
1
|
||||
2
|
||||
3
|
||||
5
|
||||
6
|
||||
4
|
||||
]
|
||||
[
|
||||
1
|
||||
2
|
||||
6
|
||||
3
|
||||
5
|
||||
4
|
||||
]
|
||||
[
|
||||
1
|
||||
2
|
||||
5
|
||||
3
|
||||
6
|
||||
4
|
||||
]
|
||||
];
|
||||
};
|
||||
|
||||
hypnos-2 = {
|
||||
|
@ -81,6 +109,20 @@ let
|
|||
from = 1;
|
||||
to = 3;
|
||||
};
|
||||
permutations = [
|
||||
[
|
||||
1
|
||||
2
|
||||
]
|
||||
[
|
||||
1
|
||||
2
|
||||
]
|
||||
[
|
||||
1
|
||||
2
|
||||
]
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue