Skip to content

Commit a572818

Browse files
committed
Remove WiFi AP configuration
1 parent d303075 commit a572818

File tree

2 files changed

+1
-59
lines changed

2 files changed

+1
-59
lines changed

ci/ios/test-router/README.md

+1-9
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
# Router setup
22
## Installing on a new router/computer
3-
- Obtain an x86 computer with 2 ethernet and 1 WiFi interface.
3+
- Obtain an x86 computer with 2 ethernet interfaces.
44
- Install NixOS on the hardware following the [NixOS installation guide]
55
- Copy the generated `/etc/nixos/hardware-config.nix` file to the flake repo, add it to git.
66
- Add a new _nixosConfiguration_ entry in `flake.nix`, following `app-team-ios-lab` as an example, making sure to import
77
the hardware config.
88
* Be sure to include the `hardware-config.nix` file as it contains the mount config for the partitions.
99
* Set the appropriate args for the `./router-config.nix` import, as to not clash with existing SSIDs.
1010

11-
- Create `/wifi-password` and `/wifi-sae-passwords` files on the router, they should contain an ASCII password of 8-63
12-
characters in length.
1311
- Apply the new configuration either via SSH or by copying the flake over to the nix machine
1412
* `nixos-reubild switch .#$newMachine --target-host root@$newMachine-ip` if one can SSH into the machine
1513
* `nixos-reubild switch .$pathToFlake#$newMachine` if flake is copied to nix machine, with `$pathToFlake` being the
@@ -29,7 +27,6 @@ To do this, add a `nixosConfiguration` with an extra import of the installer ISO
2927
ssid = "app-team-ios-tests";
3028
lanMac = "48:21:0b:36:bb:52";
3129
wanMac = "48:21:0b:36:43:a3";
32-
wifiMac = "bc:6e:e2:a8:38:51";
3330
lanIp = "192.168.105.1/24";
3431
})
3532
"${nixpkgs}/nixos/modules/installer/cd-dvd/installation-cd-minimal.nix"
@@ -49,9 +46,4 @@ And build it like so:
4946
dialog, TCP connections to `8.8.8.8:80` are NAT'ed to the gateway address.
5047

5148

52-
53-
5449
[NixOS installation guide]: https://nixos.org/manual/nixos/stable/#sec-installation-graphical
55-
[`wifi-password`]: https://search.nixos.org/options?channel=23.11&show=services.hostapd.radios.%3Cname%3E.networks.%3Cname%3E.authentication.wpaPasswordFile&from=0&size=50&sort=relevance&type=packages&query=hostapd+password
56-
[`wifi-sae-password`]: https://search.nixos.org/options?channel=23.11&show=services.hostapd.radios.%3Cname%3E.networks.%3Cname%3E.authentication.saePasswordsFile&from=0&size=50&sort=relevance&type=packages&query=hostapd+password
57-

ci/ios/test-router/router-config.nix

-50
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
args@{ hostname
22
, # hostname of the router
33
lanMac ? null
4-
, # MAC address of the local area network interface
5-
wifiMac ? null
64
, # MAC address of the local area network interface
75
wanMac
86
, # MAC address of the upstream interface
@@ -50,10 +48,6 @@ in
5048
linkConfig.Name = "lanEth";
5149
};
5250

53-
"1-wifiIface" = ifNotNull wifiMac {
54-
matchConfig.PermanentMACAddress = args.wifiMac;
55-
linkConfig.Name = "wifi";
56-
};
5751
"1-wanIface" = {
5852
matchConfig.PermanentMACAddress = args.wanMac;
5953
linkConfig.Name = "wan";
@@ -141,11 +135,6 @@ in
141135
# "/org/freedesktop/network1/link/${link_id}" \
142136
# org.freedesktop.network1.DHCPServer \
143137
# Leases
144-
systemd.network.networks."wifi" = ifNotNull wifiMac {
145-
matchConfig.Name = "wifi";
146-
networkConfig.Bridge = "lan";
147-
linkConfig.RequiredForOnline = "enslaved";
148-
};
149138

150139
systemd.network.networks."lanEth" = ifNotNull lanMac {
151140
matchConfig.Name = "lanEth";
@@ -235,45 +224,6 @@ in
235224
'';
236225
};
237226

238-
# WiFi is only enabled if a MAC address is supplied
239-
services.hostapd.enable = !builtins.isNull wifiMac;
240-
systemd.services.hostapd = ifNotNull wifiMac {
241-
bindsTo = [ "sys-subsystem-net-devices-wifi.device" ];
242-
};
243-
244-
services.hostapd.radios.wifi = ifNotNull wifiMac {
245-
wifi5.enable = false;
246-
wifi4.capabilities = [ "HT40+" "HT40-" "HT20" "SHORT-GI-20" "SHORT-GI-40" "SHORT-GI-80" ];
247-
248-
countryCode = "SE";
249-
band = "2g";
250-
networks.wifi = {
251-
# the regular NixOS config is too strict w.r.t. to old WPA standards, so for increased compatibility we should use this.
252-
settings = {
253-
"channel" = lib.mkForce "7";
254-
"driver" = lib.mkForce "nl80211";
255-
"ht_capab" =
256-
lib.mkForce "[HT40+][HT40-][HT20][SHORT-GI-20][SHORT-GI-40]";
257-
"hw_mode" = lib.mkForce "g";
258-
"ieee80211w" = lib.mkForce "1";
259-
"ieee80211d" = lib.mkForce "1";
260-
"ieee80211h" = lib.mkForce "1";
261-
"ieee80211n" = lib.mkForce "1";
262-
"noscan" = lib.mkForce "0";
263-
"require_ht" = lib.mkForce "0";
264-
"wpa_key_mgmt" = lib.mkForce "WPA-PSK WPA-PSK-SHA256 SAE";
265-
"group_mgmt_cipher" = lib.mkForce "AES-128-CMAC";
266-
};
267-
ssid = args.hostname;
268-
authentication = {
269-
mode = "wpa2-sha256";
270-
# ¡¡¡ CREATE THESE FILES WITH THE NECESSARY PASSWORD !!!
271-
wpaPasswordFile = "/wifi-password";
272-
saePasswordsFile = "/wifi-sae-passwords";
273-
};
274-
};
275-
};
276-
277227
services.shadowsocks = {
278228
enable = true;
279229
port = 443;

0 commit comments

Comments
 (0)