WIFI startup fail: NAS ID (nas_identifier) no longer optional when "802.11r Fast Transition" enabled [SNAPSHOT - r23375-cdfcac6e24]

After updating

hostapd-common
wpad-basic-mbedtls

logread contained this error message

daemon.err hostapd: FT (IEEE 802.11r) requires nas_identifier to be configured as a 1..48 octet string

The value of
"Network/Wireless/<SomeNetwork>/Edit/Interface Configuration/WLAN roaming/NAS ID"
needs to be populated, it's not optional anymore.

Once that is done, WIFI startup succeeds.

Unless you have another problem with radio_config_id

1 Like

I have read multiple postings about very strange problems in various parts of OpenWRT. One common nominator seems to be that users are updating packages with opkg. I think that there is a quile wide consensus that you should not use the opkg update option. Instead flash the router with new snapshot.

But the problem is that even replacing one wpad implementation with another (mesh compatible or just full) cause hostapd-common upgrade, as I just found.

At the moment I use RC3 with wpad-mbedtls 2023-06-22-599d00be-1.2 with 802,11s meshes without any problems. I have used also many snapshots and replaced the wpad-basic-mbedtls with wpad-mbedtls. I use command line "opkg remove wpad-basic-mbedtls" and "opkg install wpad-mbedtls" commands.

Try same thing today and see what will happen.

Not OK:

NAS ID

Used for two different purposes: RADIUS NAS ID and 802.11r R0KH-ID.
Not needed with normal WPA(2)-PSK.

This (not putting any IDs/# here) worked till recently.
using wpad-mbedtls and hostapd-common

DISTRIB_REVISION='r23389-5deed175a5'
DISTRIB_TARGET='ipq40xx/mikrotik'
DISTRIB_ARCH='arm_cortex-a7_neon-vfpv4'
DISTRIB_DESCRIPTION='OpenWrt 23.05.0-rc3 r23389-5deed175a5'

just booted in rc2:
DISTRIB_REVISION='r23228-cd17d8df2a'
DISTRIB_TARGET='ipq40xx/mikrotik'
DISTRIB_ARCH='arm_cortex-a7_neon-vfpv4'
DISTRIB_DESCRIPTION='OpenWrt 23.05.0-rc2 r23228-cd17d8df2a'

same wpad and hostpad packages
and it works here!

Issue with 'radio_config_id', in my case, appeared with fresh flash of the router.

1 Like

When I leave the option in luci empty, 'nas_id=' is automatically set to mac of the interface. I noticed that when I was investigating my 'radio_config_id' issue. So, in your case, it's missing from the 'hostapd*,conf's completely? (When not set manually)

it's there, but it seems hostapd does not know what to do with it.
I can't verify this till monday when i am onsite.

(am back on rc2 and playing with DAWN - that i can do remote)

Place following code in: '/lib/netifd/wireless/mac80211.sh' behind 'bssid=$macaddr' which is on the row 523:

nas_identifier=$(echo "$macaddr" | tr -d ':' | tr 'A-F' 'a-f')
1 Like

As you stated nas_id (which is item from '/etc/config/wireless') became no longer an optional value.

The "optionality" of this configuration item is/was done by using mac addr (stripped of semicolons and and in lower case format), and setting as 'nas_identifier' in '/var/run/hostapd-phy*.conf' (this is configuration file which is generated by '/lib/netifd/wireless/mac80211.sh').

I was just providing a way how to restore this behavior by editing the '/lib/netifd/wireless/mac80211.sh' file. Ofc just simply setting the item using luci is just another approach (but more work in my opinion).

Why is it broken is outside of my knowledge atm.

1 Like

Thank you, I can and will update around whatever faults OpenWRT may have, but it's easier to work around, if you know your challenges. Thanks for your input.

1 Like

I think you are correct and your solution is also correct. Maybe a "if not already populated" might be even better than that, but I didnt't even offer a solution. Yours is better, all the way

Sure you can do a check and set the 'nas_identifier' only when necessary (not set from uci config).

There are two possible approaches, either use of the uci and look for the 'nas_id' in wireless configuration file or in place of the edit of 'mac80211.sh' and look in the 'hostapd_cfg' value (which is content of generated configuration of hostapd) where you look directly for 'nas_identifier'.

1 Like

The cleanest solution I could come up with is to insert the following line at row 596 in the file /lib/netifd/hostapd.sh:

set_default nasid "$(echo "$macaddr" | tr -d ':' | tr 'A-F' 'a-f')"
1 Like

Thanks, that works fine, doesn't override configuration values.

I kept one of the "WLAN roaming/NAS ID" values unconfigured, the rest of them as I did in the workaround, this is what I got after a restart;

root@abcd:~# grep -rin nas_identifier /var/run/
/var/run/hostapd-phy1.conf:70:nas_identifier=123abc456def
/var/run/hostapd-phy1.conf:113:nas_identifier=12AB
/var/run/hostapd-phy2.conf:65:nas_identifier=12CD
/var/run/hostapd-phy2.conf:108:nas_identifier=12EF

First one (the one I didn't configure manually) is the MAC, the others took the configured values.

Looks correct.

It does work correctly, but doesn't make it's way back up to the GUI. The values are all gone on the LUCI GUI, even the manually configured entries.

Not just for the particular WIFI they were configured for, but for ALL of the networks.

Interesting. And what about '/etc/config/wireless'?