Commit Graph

1048 Commits

Author SHA1 Message Date
Rany Hany
a7790ce410 wifi-scripts: bump reassociation_deadline default to 20000
Most users on forums face a broken 802.11r setup when having
a very simple 802.11r config (i.e., just ieee80211r enabled).

In most cases, simply bumping reassociation_deadline to
20000 fixes their problems and allows 802.11r to just work.

Reassociation Deadline is already set to 20 seconds on Cisco
equipment by default[1] which is why this value has been
chosen.

It is also mentioned on the OpenWRT Wiki as a value that should
be changed in order for 802.11r to work on Apple devices. I think
it would be better to change the defaults instead so users don't
have to do much work for a working setup.

[1]: https://www.cisco.com/c/en/us/td/docs/wireless/controller/technotes/80211r-ft/b-80211r-dg.html

Fixes: https://github.com/openwrt/openwrt/issues/7907
Signed-off-by: Rany Hany <rany_hany@riseup.net>
Link: https://github.com/openwrt/openwrt/pull/20799
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-11-19 18:54:27 +01:00
Rany Hany
b947064db4 wifi-scripts: allow rssi_reject_assoc_timeout to be configured
This is useful to alter the default ban time after an STA
association is rejected for being below RSSI threshold.

Signed-off-by: Rany Hany <rany_hany@riseup.net>
Link: https://github.com/openwrt/openwrt/pull/20811
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-11-19 13:57:30 +01:00
Zhi-Jun You
7ea377ed71 wifi-scripts: ucode: fix init value of config.ht_capab under 20MHz
Currently the path for setting 20MHz doesn't set ht_capab to '' at the
beginning which results in null in ht_capab in hostapd.conf.

Fix this by setting config.ht_capab to '' for 20MHz htmode.

Fixes: #20762

Signed-off-by: Zhi-Jun You <hujy652@protonmail.com>
Link: https://github.com/openwrt/openwrt/pull/20768
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-11-15 19:45:37 +01:00
Rany Hany
6df060ba4a wifi-scripts: ucode: create wpa_psk_file and sae_password_file when needed
This handles the case when 'wpad' or 'wpad-mini' package is used which is
missing WPA3 support. This makes it impossible to use ucode wifi-scripts
on such APs as it will raise an error:

   daemon.err hostapd: Line 87: unknown configuration item 'sae_password_file'

This also achieves parity with what is currently happening with old wifi-scripts.
The behavior now matches.

Fixes: https://github.com/openwrt/openwrt/issues/20781
Signed-off-by: Rany Hany <rany_hany@riseup.net>
Link: https://github.com/openwrt/openwrt/pull/20784
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-11-15 11:13:36 +01:00
Felix Fietkau
92445cc982 wifi-scripts: respect rsn_override=0 in mixed modes
Only set rsn_override_key_mgmt when rsn_override is enabled.

Reported-by: Michael-cy Lee (李峻宇) <Michael-cy.Lee@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2025-11-13 12:41:42 +00:00
Felix Fietkau
ff44aa490a wifi-scripts: only enable RSN override when parameters differ
When encryption is set to 'sae' without explicit pairwise cipher in
non-HE/EHT mode, both the main RSNE and override RSNE would advertise
identical parameters (SAE+CCMP+MFP=2), adding unnecessary overhead.

Check that the pairwise ciphers differ before enabling override. This
preserves the intended behavior for HE/EHT modes (GCMP-256+CCMP vs CCMP)
while avoiding pointless override IEs.

Reported-by: Michael-cy Lee (李峻宇) <Michael-cy.Lee@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2025-11-13 12:26:59 +00:00
Felix Fietkau
75791ea634 wifi-scripts: fix MLO AP setup with disabled radios
When an MLO interface specifies multiple radios and the first radio
is disabled, the MLO configuration was never created because the code
only attempted to create it when processing the first device in the
list (which gets skipped if disabled).

Fix by creating the MLO config for the first enabled device instead
of only when processing dev_names[0].

Reported-by: Michael-cy Lee (李峻宇) <Michael-cy.Lee@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2025-11-13 11:56:39 +00:00
Felix Fietkau
d619ff6872 wifi-scripts: fix wds client mode with MLO
Ensure that the 4addr flag is passed to phy.wdev_add.

Reported-by: Michael-cy Lee (李峻宇) <Michael-cy.Lee@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2025-11-13 11:56:39 +00:00
Andy Chiang
00e881451a wifi-scripts: ucode: fix start failed
When using wpad-openssl/wpad-basic-openssl, wpa_supplicant/hostapd may not be ready because of openssl.
This cause supplicant.setup and hostapd.setup to be failed.
Therefore, wait for wpa_supplicant/hostapd to be ready before supplicant.setup and hostapd.setup.

Run-tested: mediatek/filogic GL-MT3000
fixes: #20361

Signed-off-by: Andy Chiang <AndyChiang_git@outlook.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2025-11-12 13:45:50 +01:00
Paweł Owoc
cc3e211264 wifi-scripts: use stationary_ap conf for AX mode
Use stationary_ap configuration for 6GHz AX AP (not only BE).
This change fixes the 6GHz network not visible issue for QCN9024.

Signed-off-by: Paweł Owoc <frut3k7@gmail.com>
2025-11-12 12:14:53 +01:00
Andy Chiang
4ad22d0342 firewall: config: add dest addr restrictions for DHCPv6 rules
Some ISPs may use a GUA or other non-LLA as the source addr for the DHCPv6 response, but the destination addr is always LLA (fe80::/10).
Therefore, adding a dest addr restriction improves security.
See https://forum.mikrotik.com/t/xfinity-comcast-dhcpv6-configuration-change/156031/10

Signed-off-by: Andy Chiang <AndyChiang_git@outlook.com>
Link: https://github.com/openwrt/openwrt/pull/20562
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-11-10 15:23:16 +01:00
Rany Hany
df338d67d4 wifi-scripts: allow sae_password_file to be configured
Adds missing config_add_string for sae_password_file.

Fixes: 65a1c666f2 ("hostapd: add SAE support for wifi-station and optimize PSK file creation")
Fixes: https://github.com/openwrt/openwrt/issues/19717
Signed-off-by: Rany Hany <rany_hany@riseup.net>
Link: https://github.com/openwrt/openwrt/pull/19964
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-11-10 15:21:45 +01:00
Eneas U de Queiroz
0b9111301b wifi-scripts: ucode: iwinfo: expand AKM display
This exands the list of AKMs to display:
 - display the hash when larger than the default (loosely based on
   what hostapd uses in config).
   - renaming 'WPA PSK2' to 'WPA PSK-SHA256' as a result
 - separate FILS suites from plain 802.1x
 - add suites 3, 5, 9, 19, 20, 24, and 25

Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/20686
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-11-10 11:46:55 +01:00
Eneas U de Queiroz
988b2ed515 wifi-scripts: ucode: iwinfo: escape control chars
Escape control characters when displaying ESSID.  It is not uncommon for
a scan to encounter invalid SSIDs, containing binary data.  Escape the
control characters to avoid messing the display (ENQ is particularly
bothersome).

Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/20686
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-11-10 11:46:55 +01:00
Eneas U de Queiroz
e50703d033 wifi-scripts: ucode: iwinfo: show ESSID in scan
This adds the ESSID: line to the iwinfo scan results.

Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/20686
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-11-10 11:46:55 +01:00
Rany Hany
4c5df354df wifi-scripts: ucode: add SAE support for wifi-station and PPSK
This implements 65a1c666f2 ("hostapd: add SAE support for wifi-station
and optimize PSK file creation") and 913368a2 ("hostapd: add support for
SAE in PPSK option") for the ucode version as well.

Signed-off-by: Rany Hany <rany_hany@riseup.net>
Link: https://github.com/openwrt/openwrt/pull/19965
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-11-08 12:09:31 +01:00
Rany Hany
372fc5419c wifi-scripts: ucode: fix setting tx_queue_data2_burst in config
Currently we unconditionally set it to 2.0 if 802.11ac and disregard
what the user set. This sets it to 2.0 only as a default in case
user didn't specify a tx_burst setting.

Signed-off-by: Rany Hany <rany_hany@riseup.net>
Link: https://github.com/openwrt/openwrt/pull/20565
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-11-07 21:18:15 +01:00
Rany Hany
8e457b69a2 wifi-scripts: add sae_track_password option
This is useful if multiple passwords were specified without
the use of a SAE password identifier. This is the only
way to get multiple passwords for a single peer to work
without resorting to password identifiers.

Unfortunately, support for password identifiers is non-existent
on Android and macOS; and possibly others. So this is the only
option in that case.

As an alternative, one could also continue to use WPA2-PSK instead
as that could easily resort to a bruteforce approach without any
complications.

Signed-off-by: Rany Hany <rany_hany@riseup.net>
Link: https://github.com/openwrt/openwrt/pull/20597
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-11-07 21:17:04 +01:00
Rany Hany
bcdb29f78f wifi-scripts: add na_mcast_to_ucast option
As this is generally only useful with "proxy_arp" enabled,
we default na_mcast_to_ucast to true if "proxy_arp" is already
enabled.

Signed-off-by: Rany Hany <rany_hany@riseup.net>
Link: https://github.com/openwrt/openwrt/pull/20596
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-11-07 21:15:09 +01:00
Eneas U de Queiroz
ed3f84e091
wifi-scripts: ucode: fix hostapd_bss_options
The raw option inside 'config wifi-iface' is called hostapd_bss_options,
not hostapd_options.

Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/20657
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2025-11-07 19:41:01 +01:00
Leon M. Busch-George
66e5e9671f wifi-scripts: ucode: fix check for empty crypto object while scanning
it can be empty

Signed-off-by: Leon M. Busch-George <leon@georgemail.eu>
Link: https://github.com/openwrt/openwrt/pull/20526
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-10-27 14:22:58 +01:00
Felix Fietkau
4c50648f72 netifd: update to Git HEAD (2025-10-20)
df2f5c9a30f8 veth: delete device before creation to handle stale state
b6d371f30770 system-linux: handle RTM_DELLINK events for device state tracking
777f5942fa7d system-linux: only parse device status for AF_UNSPEC link messages

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2025-10-21 07:24:46 +02:00
Felix Fietkau
a1f42ab3c7 wifi-scripts: ucode: add missing bssid for adhoc interfaces
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2025-10-20 10:50:01 +02:00
Felix Fietkau
6797cabb79 wifi-scripts: ucode: prefer basic rates from iface over device
Sync with the behavior from the legacy scripts

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2025-10-20 10:50:01 +02:00
Felix Fietkau
94fb40941b wifi-scripts: ucode: fix issues in mesh setup without supplicant
- Add missing frequency
- Call the correct function for htmode

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2025-10-20 10:50:01 +02:00
Aleksander Jan Bajkowski
1035615731 wifi-scripts: ucode: export HE and EHT operation in scan results
Export WiFi 6E (HE) and WiFi 7 (EHT) operation data in scan results.
These additional data can be useful to check wifi channel utilization
by nearby stations.

Example:
Cell 32 - Address: xx:xx:xx:xx:xx:xx
          Mode: Master  Frequency: 6.115 GHz  Band: 6 GHz  Channel: 33
          Signal: -14 dBm  Quality: 70/70
          Encryption: SAE (CCMP)
          HE Operation:
                Center Frequency 1: 39
                Center Frequency 2: 47
                Channel Width: 160 MHz
          EHT Operation:
                Center Frequency 1: 47
                Center Frequency 2: 63
                Channel Width: 320 MHz

Signed-off-by: Aleksander Jan Bajkowski <olek2@wp.pl>
Link: https://github.com/openwrt/openwrt/pull/19208
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-10-20 00:38:50 +02:00
David Härdeman
9151c7015e netifd: use the global DHCP DUID for DHCPv4
This makes the DHCPv4 client use the global DHCP DUID to generate a
RFC4361-style client identifier.

Signed-off-by: David Härdeman <david@hardeman.nu>
Link: https://github.com/openwrt/openwrt/pull/20359
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-10-19 19:46:22 +02:00
Felix Fietkau
0fe9484fed wifi-scripts: ucode: add support for WPS client
Fixes unwanted fallback to unencrypted network.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2025-10-15 09:56:33 +02:00
Zhi-Jun You
6a68c2fef0 wifi-scripts: ucode: fix airtime_mode with hostapd-mini
Currently wifi-scripts ucode appends airtime_mode to hostapd config file
unconditionally.
However this breaks bringing up interface with hostapd-mini
because the mini variant doesn't support airtime policy.

Fix this by changing the script to append airtime_mode only when
airtime_mode is set to greater than zero value in /etc/config/wireless.

Fixes: #20136
Fixes: #20314

Signed-off-by: Zhi-Jun You <hujy652@protonmail.com>
2025-10-13 10:56:39 +02:00
Felix Fietkau
09ae2daa7c netifd: update to Git HEAD (2025-10-06)
649028013a3c config: fix overriding bridge-vlan sections via procd data

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2025-10-06 09:56:27 +02:00
Hauke Mehrtens
eadb0df58d firewall: update to Git HEAD (2025-10-03)
3a65fde5a3e6 build: require CMake >= 3.10 due to dropped legacy support

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-10-04 12:04:17 +02:00
Felix Fietkau
727d8b27ab wifi-scripts: retry setup of wireless devices that show up late
When a phy appears after setup has already been attempted, tell netifd
to retry setup for all failed wireless devices.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2025-10-02 13:30:31 +02:00
Felix Fietkau
915a57ccd9 netifd: send event after running wireless handler
This can be used by other services to trigger reconfiguration, or detect when
PHY renaming has been performed.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2025-10-02 11:04:38 +02:00
Felix Fietkau
8c399b4905 wifi-scripts: ucode: only set a hostapd config if it has interfaces
Do not pass invalid configs to hostapd.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2025-10-02 10:47:34 +02:00
Felix Fietkau
4b7323e3bf netifd: always call setup for disabled radios
Ensures that renaming is handled properly. For disabled radios, setup is
performed with an empty list of interfaces.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2025-10-02 10:47:34 +02:00
Felix Fietkau
a60bc69acd netifd: update to Git HEAD (2025-09-30)
c3bf8fd913a4 interface: fix reload for devices that point to vlan aliases
22216cac7c94 bridge: fix reload when ports refer to aliased vlans on another bridge
ecca21ca07dd system: add logging wrappers for basic system functions

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2025-10-01 10:08:54 +02:00
Felix Fietkau
3d8d525b21 wifi-scripts: ucode: add support for setting Multi-AP profile/vlanid
Required for Profile-2 support.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2025-10-01 10:08:54 +02:00
Felix Fietkau
d761f6a5a5 wifi-scripts: ucode: add start_disabled for AP mode
Enable it, whenever the AP needs to wait for a supplicant instance.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2025-09-29 12:37:02 +02:00
Felix Fietkau
37770c503b wifi-scripts: force wmm_enabled to 1 in AP mode, remove option
There are no supported drivers where it even makes sense to disable WMM
anymore, since so much depends on it.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2025-09-28 18:17:35 +02:00
Felix Fietkau
0da0a6c449 wifi-scripts: ucode: fix r0kh/r1kh parsing
The option is an array, and for each entry there should be one generated
line in hostapd.conf. Commas also need to be replaced with whitespace

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2025-09-25 13:03:41 +02:00
Felix Fietkau
ce3ab2646b wifi-scripts: ucode: add support for the legacy hwmode option
Some configs that are many years old still have it set instead of band

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2025-09-25 09:41:25 +02:00
Felix Fietkau
9aca8a97d7 wpa_supplicant: add MLO client support
Can also be used for a client mode interface that is able to connect on
multiple bands individually, while handling hostapd state for the correct
band.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2025-09-24 13:45:59 +02:00
Felix Fietkau
b11a6a1c5a wifi-scripts: ucode: fix client mode scan list support
- fix the variable name in the configuration file
- provide a default scan list in case the user did not configure it (MLO preparation)

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2025-09-24 13:45:40 +02:00
Felix Fietkau
009a9e0478 wifi-scripts: simplify MLO handling
Move mlo specific hostapd ubus call from wireless handler to netifd core
ucode script. This avoids unnecessary queueing and the fake MLO wireless
device.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2025-09-24 13:45:40 +02:00
Felix Fietkau
04e9929c47 wifi-scripts: enable ucode scripts by default
They are required for MLO support

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2025-09-24 13:45:40 +02:00
Felix Fietkau
bd80c05c11 netifd/wifi-scripts: use shared global connection for ubus
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2025-09-24 13:45:40 +02:00
Felix Fietkau
125c974bf7 netifd: update to Git HEAD (2025-09-12)
2a85440bcd82 netifd: fix misplaced ")"

Fixes: https://github.com/openwrt/netifd/issues/54
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2025-09-12 11:29:07 +02:00
Oldřich Jedlička
41aceb2de8 wifi-scripts: ucode: print unknown ssid as unknown
Currently it is printed as "null" (including quotes). Display it the same
as old iwinfo as unknown (no quotes).

Signed-off-by: Oldřich Jedlička <oldium.pro@gmail.com>
2025-09-02 09:48:35 +02:00
Oldřich Jedlička
1756dddb9f wifi-scripts: ucode: fix dynamic_vlan value handling
The dynamic_vlan has values 0 (disabled), 1 (optional) and 2 (required).

Signed-off-by: Oldřich Jedlička <oldium.pro@gmail.com>
2025-09-02 09:33:19 +02:00
Oldřich Jedlička
2146f5c31f wifi-scripts: ucode: set default wildcard mac for wifi-station
When creating the PSK file, the old script sets `mac` to
`00:00:00:00:00:00` when `mac` is not specified (see [here][1]),
creating hostapd configuration lines like:

  vlanid=10 00:00:00:00:00:00 MyStrongPassword

That matches any MAC address (a wildcard). The `ucode` script alternative
misses the default, so set it.

[1]: 9c26d14489/package/network/config/wifi-scripts/files/lib/netifd/hostapd.sh (L428)

Signed-off-by: Oldřich Jedlička <oldium.pro@gmail.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2025-09-02 09:31:56 +02:00