How to solve hostapd dexcessive "deauthenticated due to local deauth request"

HI folks

After searching everywhere, I decided to ask for help here.


I using a MT7621 compatible router with 19.07.4 firmware, but from time to time some computers/cellphones are not able to connect to my 802.11 n network (802.11 ac works fine).

Checking logs I have several messages like these:

Sat Nov 27 20:07:11 2021 daemon.notice hostapd: wlan0: STA xx:xx:xx:xx:xx:xx IEEE 802.11: Could not add STA to kernel driver
Sat Nov 27 20:07:12 2021 daemon.notice hostapd: wlan0: STA xx:xx:xx:xx:xx:xx IEEE 802.11: Could not add STA to kernel driver
Sat Nov 27 20:07:13 2021 daemon.info hostapd: wlan0-1: STA xx:xx:xx:xx:xx:xx IEEE 802.11: authenticated
Sat Nov 27 20:07:13 2021 daemon.info hostapd: wlan0-1: STA xx:xx:xx:xx:xx:xx IEEE 802.11: authenticated
Sat Nov 27 20:07:13 2021 daemon.info hostapd: wlan0-1: STA xx:xx:xx:xx:xx:xx IEEE 802.11: authenticated
Sat Nov 27 20:07:13 2021 daemon.info hostapd: wlan0-1: STA xx:xx:xx:xx:xx:xx IEEE 802.11: authenticated
Sat Nov 27 20:07:16 2021 daemon.info hostapd: wlan0-1: STA xx:xx:xx:xx:xx:xx IEEE 802.11: deauthenticated due to local deauth request

The only way to get rid of these messages and be able to connect devices is to restarting my router. My concern is this is very frequent and restarting is palliative. It can come back in 2 days or it can take 10 minutes to happen again. It is driving me nuts.

I tried to tweak every wireless parameter recommendations, but without success.

Here is my /etc/config/wireless config

config wifi-device 'radio0'
	option type 'mac80211'
	option hwmode '11g'
	option path 'pci0000:00/0000:00:01.0/0000:02:00.0'
	option channel '11'
	option noscan '1'
	option legacy_rates '0'
	option htmode 'HT40'
	option country 'US'
	option txpower '20'

config wifi-iface 'default_radio0'
	option device 'radio0'
	option network 'lan'
	option mode 'ap'
	option key '********'
	option ssid 'WIRELESS_2.4GHZ'
	option disassoc_low_ack '0'
	option max_inactivity '900'
	option skip_inactivity_poll '1'
	option wpa_group_rekey '86400'
	option wpa_disable_eapol_key_retries '1'
	option wpa_strict_rekey '1'
	option max_listen_interval '65535'
	option encryption 'psk2+ccmp'
	option ieee80211w '1'

config wifi-device 'radio1'
	option type 'mac80211'
	option hwmode '11a'
	option path 'pci0000:00/0000:00:00.0/0000:01:00.0'
	option htmode 'VHT80'
	option legacy_rates '0'
	option channels '36 40 44 48 149 153 157 161 165'
	option country 'US'
	option channel '44'

config wifi-iface 'default_radio1'
	option device 'radio1'
	option network 'lan'
	option mode 'ap'
	option key '********'
	option ssid 'WIRELESS_5GHZ'
	option disassoc_low_ack '0'
	option max_inactivity '900'
	option skip_inactivity_poll '1'
	option wpa_group_rekey '86400'
	option wpa_disable_eapol_key_retries '1'
	option encryption 'psk-mixed+ccmp'

As you can see, there is nothing special, just regular setup. I also tried to tweak wireless channels, but without success.

I can't imagine what would be the main cause of this. Sometimes due excessive reboot, some IOT devices stops to connect to my wireless network and I have to reboot them manually.

1 Like

As a test, try WPA2-TKIP.

I've had a similar problem using a Linksys WRT1900AC v1 (mamba).

This frequent disassociation started when:

  • upgraded from Openwrt 19.07.3 to 21.02.1
  • added an Apple Airport with 2.4GHz sitting right next to the Openwrt router

The most problematic devices are iPhones and iPads

It's unclear why the iphones and ipads are disassociating.

MDC

Some devices go into sleep mode.

I have one static device that was being kicked that I didn't want to be kicked.

Increasing the Station inactivity limit time solved it for me.

2 Likes

Increasing station inactivity helped with my Apple devices as well. Right now I am using 3600 seconds which is 1 hour and seems to have resolved the same iPhone deauthentications. I think default was 5 minutes.

1 Like

Sorry for the late reply.

I changed 2.4GHZ network to use psk2+tip and it did not work. Same result after some time.

I increased the Station inactivity limit setting to 3600 and I hope it works :crossed_fingers:t2:

In addition, I added one of the problematic devices to Static DHCP list to see if is something related to DHCP Pool or not. It doesn't hurt to try.

1 Like

Possible workaround:

cat << "EOF" > /root/wifi-fix.sh
WIFI_MSG="deauthenticated due to local deauth request"
if logread -e hostapd \
| grep -q -e "${WIFI_MSG}"
then wifi reload
/etc/init.d/log restart
fi
EOF
cat << "EOF" >> /etc/crontabs/root
* * * * * . /root/wifi-fix.sh
EOF
uci set system.@system[0].cronloglevel="9"
uci commit system
/etc/init.d/cron restart

Did it work?

I had it with an HP 7520 printer when I played around with new settings when switching from OpenWRT 17.x to 19.x.

For me the solution was to switch off "802.11w Management Frame Protection".