nix: update inputs
[sourcephile-nix.git] / hosts / losurdo / networking / wireless.nix
index 5c449bb4fe6778a8477353b87c057762ccb9d36c..58e6f1b7460ca8651190db42c918976d8eb48b41 100644 (file)
@@ -9,7 +9,7 @@ networking.interfaces.${iface} = {
   ipv4.addresses = [ { address = "192.168.2.1"; prefixLength = 24; } ];
 };
 # Fix to set the address before starting dhcpd4.service
-systemd.services.network-addresses-${iface} = {
+systemd.services."network-addresses-${iface}" = {
   before = ["network.target"];
   wantedBy = ["network.target"];
 };
@@ -60,9 +60,11 @@ networking.networkmanager.unmanaged = [
 ];
 */
 
+# iw dev wlp4s0 station dump
+# DOC: https://w1.fi/cgit/hostap/plain/hostapd/hostapd.conf
 services.hostapd = {
   enable = true;
-  logLevel = 3;
+  logLevel = 2;
   interface = iface;
   hwMode = "g";
   ssid = "bureau1";
@@ -70,6 +72,37 @@ services.hostapd = {
   wpaPassphrase = "bidonpoissonmaisonronron";
   countryCode = "FR";
   extraConfig = ''
+    # WLAN
+    beacon_int=100
+    dtim_period=2 # DTIM (delivery trafic information message)
+    preamble=1
+    # limit the frequencies used to those allowed in the country
+    ieee80211d=1
+    # 0 means the AP will search for the channel with the least interferences (ACS)
+    channel=1
+
+    # WPA2
+    wpa_key_mgmt=WPA-PSK
+    wpa_pairwise=CCMP
+    rsn_pairwise=CCMP
+    auth_algs=1 # 0=noauth, 1=wpa, 2=wep, 3=both
+    macaddr_acl=0
+    # QoS support, also required for full speed on 802.11n/ac/ax
+    wmm_enabled=1
+    eap_reauth_period=360000
+    wpa_group_rekey=600
+    wpa_ptk_rekey=600
+    wpa_gmk_rekey=86400
+
+    # N-WLAN
+    ieee80211n=1
+    # See Capabilities in iw list
+    ht_capab=[HT40+][SHORT-GI-40][DSSS_CCK-40][MAX-AMSDU-7935]
+    require_ht=1
+    obss_interval=0
+
+    # 802.11ac support
+    ieee80211ac=0
   '';
 };
 services.dhcpd4 = {