Client mode deauthenticates seconds after association

I have a configuration that used to work but now suddenly doesn't anymore. The router is supposed to connect to an access point that provides internet connectivity. While i don't have control over the access point i can confirm that all credentials are valid because my other devices can connect to it.

I've tried resetting the connection, rebooting the router, double checking connection settings but as far as i can tell it's no obvious cause. I did notice that it does seem to connect briefly and in a matter of seconds it disconnects. The log confirms this and i've posted a segment of it in the hopes that someone sees something i don't. This pattern repeats every 30 seconds or so, when a new connection attempt is done that fails in the same way.

The udcpc receiving SIGTERM sounds like a bad thing but maybe it's not the cause as this always happens AFTER the kernel decides to deauthenticate. Which it seems to me it shouldn't be doing. Also i'm not sure how to read the line about limiting TX power. Does 23 (23 - 0) dBm mean 23 dBm or is it something like "setting 23, which is 0 dBm"? I tried setting the transmit power to auto or different fixed settings but that doesn't fix the problem. I also tried killing wpa_supplicant as suggested by others posting about DEAUTH_LEAVING but this didn't fix it for me.

I'm using OpenWrt 18.06.2 r7676-cddd7b4c77 on a Linksys RE6500

Mon Apr  1 00:08:47 2019 kern.info kernel: [ 2574.059778] wlan1: authenticate with <BSSID>
Mon Apr  1 00:08:47 2019 kern.info kernel: [ 2574.634443] wlan1: send auth to <BSSID> (try 1/3)
Mon Apr  1 00:08:47 2019 kern.info kernel: [ 2574.647980] wlan1: authenticated
Mon Apr  1 00:08:47 2019 kern.info kernel: [ 2574.664850] wlan1: associate with <BSSID> (try 1/3)
Mon Apr  1 00:08:47 2019 kern.info kernel: [ 2574.697917] wlan1: RX AssocResp from <BSSID> (capab=0x1431 status=0 aid=1)
Mon Apr  1 00:08:47 2019 kern.info kernel: [ 2574.713609] wlan1: associated
Mon Apr  1 00:08:47 2019 daemon.notice netifd: Network device 'wlan1' link is up
Mon Apr  1 00:08:47 2019 daemon.notice netifd: Interface 'wwan' has link connectivity
Mon Apr  1 00:08:47 2019 daemon.notice netifd: Interface 'wwan' is setting up now
Mon Apr  1 00:08:47 2019 daemon.notice netifd: wwan (12265): udhcpc: started, v1.28.4
Mon Apr  1 00:08:48 2019 kern.debug kernel: [ 2574.871147] wlan1: Limiting TX power to 23 (23 - 0) dBm as advertised by <BSSID>
Mon Apr  1 00:08:48 2019 daemon.notice netifd: wwan (12265): udhcpc: sending discover
Mon Apr  1 00:08:51 2019 kern.info kernel: [ 2577.865065] wlan1: deauthenticating from <BSSID> by local choice (Reason: 3=DEAUTH_LEAVING)
Mon Apr  1 00:08:51 2019 daemon.notice netifd: Network device 'wlan1' link is down
Mon Apr  1 00:08:51 2019 daemon.notice netifd: Interface 'wwan' has link connectivity loss
Mon Apr  1 00:08:51 2019 daemon.notice netifd: wwan (12265): udhcpc: sending discover
Mon Apr  1 00:08:51 2019 daemon.notice netifd: wwan (12265): udhcpc: received SIGTERM
1 Like

What is your configuration?

UDHCPc is the DHCP client. I believe it got a SIGTERM because the network device link was set to down.

Could you also write 'rfkill list'? (that is if your router has that included)

I tried rfkill via ssh but it says not found.
The order of things is always as in the log snippet, udhpc starts, tx power is limited, udhpc sends discover and two or three seconds later comes the DEAUTH_LEAVING and then udhcoc gets SIGTERM. So it could still mean that the deauth is somehow caused by udhcpc but starting and sending a discover seems normal business that should succeed.
Which part of the configuration would you like to see? Here is /tmp/run/wpa_supplicant-wlan1.conf

country=00
network={
        scan_ssid=1
        ssid="ssid"
        key_mgmt=WPA-EAP
        identity="<identity>"
        password="<password>"
        phase2="auth=MSCHAPV2"
        eap=PEAP
        proto=RSN
        bssid=<BSSID>
        beacon_int=100
}

There are no logs at all about authorization? Are you using the full wpad? The default install is wpad-mini, which does not support "Enterprise" authorization.

I am indeed using the full wpad and i've removed wpad-mini because this network needs Enterprise authentication. I don't suspect any malfunctions there because it can connect to one other enterprise network that is also in the air. In addition as i said earlier other devices can connect using the same credentials and the log snippet i posted suggests that authentication succeeds. I don't suspect that the error is in authentication but i'll gladly show you any logs if you tell me where i can find them. I know about the kernel log and system log that you can get to through LuCI. Other than that i know how to ssh and read files but i don't know where any authorization logs are.

I am more interested in the wireless configuration you've set up.

You can get that by either typing cat /etc/config/wireless or 'uci show wireless'. It would also be useful if you could provide the configuration of other devices that are actually able to persistently connect to the AP.

You can try disabling power management as well. Though that might not be a very graceful fix.

Allright, the wireless config according to cat /etc/config/wireless is:

config wifi-device 'radio0'
        option type 'mac80211'
        option hwmode '11a'
        option path 'pci0000:00/0000:00:00.0/0000:01:00.0'
        option country '00'
        option legacy_rates '0'
        option htmode 'VHT40'
        option disabled '0'
        option channel '108'
        option txpower '12'

config wifi-device 'radio1'
        option type 'mac80211'
        option hwmode '11g'
        option path 'pci0000:00/0000:00:01.0/0000:02:00.0'
        option htmode 'HT20'
        option country '00'
        option legacy_rates '0'
        option distance '1000'
        option disabled '0'
        option channel '1'
        option txpower '17'

config wifi-iface
        option network 'wwan'
        option ssid '<upstream ssid>'
        option device 'radio1'
        option mode 'sta'
        option bssid '<upstream bssid>'
        option short_preamble '0'
        option disassoc_low_ack '0'
        option encryption 'wpa2'
        option eap_type 'peap'
        option auth 'EAP-MSCHAPV2'
        option identity '<identity>'
        option password '<password>'

config wifi-iface
        option device 'radio0'
        option mode 'ap'
        option ssid '<local accesspoint>'
        option network 'lan'
        option encryption 'psk2'
        option key '<password>'

I don't think there's anything below that's not already show above but for completeness uci show wireless gives:

wireless.radio0=wifi-device
wireless.radio0.type='mac80211'
wireless.radio0.hwmode='11a'
wireless.radio0.path='pci0000:00/0000:00:00.0/0000:01:00.0'
wireless.radio0.country='00'
wireless.radio0.legacy_rates='0'
wireless.radio0.htmode='VHT40'
wireless.radio0.disabled='0'
wireless.radio0.channel='108'
wireless.radio0.txpower='12'
wireless.radio1=wifi-device
wireless.radio1.type='mac80211'
wireless.radio1.hwmode='11g'
wireless.radio1.path='pci0000:00/0000:00:01.0/0000:02:00.0'
wireless.radio1.htmode='HT20'
wireless.radio1.country='00'
wireless.radio1.legacy_rates='0'
wireless.radio1.distance='1000'
wireless.radio1.disabled='0'
wireless.radio1.channel='1'
wireless.radio1.txpower='17'
wireless.@wifi-iface[0]=wifi-iface
wireless.@wifi-iface[0].network='wwan'
wireless.@wifi-iface[0].ssid='<upstream ssid>'
wireless.@wifi-iface[0].device='radio1'
wireless.@wifi-iface[0].mode='sta'
wireless.@wifi-iface[0].bssid='<upstream bssid>'
wireless.@wifi-iface[0].short_preamble='0'
wireless.@wifi-iface[0].disassoc_low_ack='0'
wireless.@wifi-iface[0].encryption='wpa2'
wireless.@wifi-iface[0].eap_type='peap'
wireless.@wifi-iface[0].auth='EAP-MSCHAPV2'
wireless.@wifi-iface[0].identity='<identity>'
wireless.@wifi-iface[0].password='<password>'
wireless.@wifi-iface[1]=wifi-iface
wireless.@wifi-iface[1].device='radio0'
wireless.@wifi-iface[1].mode='ap'
wireless.@wifi-iface[1].ssid='<local accesspoint>'
wireless.@wifi-iface[1].network='lan'
wireless.@wifi-iface[1].encryption='psk2'
wireless.@wifi-iface[1].key='<password>'

As you can see i have a local lan configured on radio 0 and the problem network lives on radio 1, although the association/request udhcpc/deauth pattern is exactly the same if i connect to the upstream on radio 0. The local lan works as expected, also regardless of which radio i put it on and clients can connect to it but obviously receive no internet because the upstream network won't connect anymore.

I did see other people mention power management options but i haven't found any in LuCI. The closest thing i found was setting the the TX power to the highest setting instead of 'auto', or any other setting for that matter. I've fixed TX power for both networks as i have always done, so these power setting should suffice.

With the search terms i use i come across a lot of Archlinux posts, and i've tried some of the tips there. Most of the time the commands they mention are not available on my router. They also mention multiple network managers interfering and killing wpa_supplicant. I do have a wpa_supplicant process running but things just stop working when i kill it so i'm guessing i don't have multiple network mangers :stuck_out_tongue: