# wlan0 deauthenticating by local choice (reason=3) reg domain

## highland

Hello

For wpa_supplicant i got associated/authenticated and immediately deauthenticate because of local choice.

I found out that i have this problem only with wireless networks which use PL regulatory domain.

For wireless networks which uses GB i have no problem.

For PL it looks like this:

```

Oct 31 10:03:21 localhost kernel: [  407.021784] wlan0: authenticate with d4:a0:2a:4a:2f:3f (try 2)

Oct 31 10:03:21 localhost kernel: [  407.023198] wlan0: authenticated

Oct 31 10:03:21 localhost kernel: [  407.023390] wlan0: associate with d4:a0:2a:4a:2f:3f (try 1)

Oct 31 10:03:21 localhost kernel: [  407.025064] wlan0: RX AssocResp from d4:a0:2a:4a:2f:3f (capab=0x11 status=0 aid=7)

Oct 31 10:03:21 localhost kernel: [  407.025067] wlan0: associated

Oct 31 10:03:21 localhost kernel: [  407.032370] ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready

Oct 31 10:03:21 localhost kernel: [  407.032414] cfg80211: Calling CRDA for country: PL

Oct 31 10:03:21 localhost kernel: [  407.034430] cfg80211: Regulatory domain changed to country: PL                                                                   

Oct 31 10:03:21 localhost kernel: [  407.034432] cfg80211:     (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)                                      

Oct 31 10:03:21 localhost kernel: [  407.034434] cfg80211:     (2402000 KHz - 2482000 KHz @ 40000 KHz), (N/A, 2000 mBm)                                               

Oct 31 10:03:21 localhost kernel: [  407.034436] cfg80211:     (5170000 KHz - 5250000 KHz @ 40000 KHz), (N/A, 2000 mBm)                                               

Oct 31 10:03:21 localhost kernel: [  407.034438] cfg80211:     (5250000 KHz - 5330000 KHz @ 40000 KHz), (N/A, 2000 mBm)                                               

Oct 31 10:03:21 localhost kernel: [  407.034439] cfg80211:     (5490000 KHz - 5710000 KHz @ 40000 KHz), (N/A, 2700 mBm)                                               

Oct 31 10:03:21 localhost kernel: [  407.034441] cfg80211:     (57240000 KHz - 65880000 KHz @ 2160000 KHz), (N/A, 4000 mBm)                                           

Oct 31 10:03:23 localhost kernel: [  409.101243] wlan0: deauthenticating from d4:a0:2a:4a:2f:3f by local choice (reason=3)

```

i have tried to set in wpa_supplicant.conf:

country=PL (or GB)

But that does not change anything.

Why i can not join to wireless networks using PL regulatory domains ?

It was working fine in the past - but i had to login to unprotected network and disabled wpa_supplicant and used iwconfig tools manually.

After that when using wpa_supplicant i am not able to join any wireless network which have PL regulatory domain (for GB it works fine).

Why ?

Upgraded to newest wpa_supplicant from gentoo repository.

Thanks

----------

## fbcyborg

Hi!

same problem here. No way to connect to a WiFi network.

----------

## Logicien

I think the deauthentification do not come from wpa_supplicant itself who is a user space application but by the kernel itself through the wireless support. You can set the regulatory domain code using a cfg80211 module kernel parameter. This module have two options

```
modinfo -p cfg80211

ieee80211_regdom:IEEE 802.11 regulatory domain code (charp)

cfg80211_disable_40mhz_24ghz:Disable 40MHz support in the 2.4GHz band (bool)
```

So, if you want PL, set in /etc/modprobe.d/modprobe.conf

```
options cfg80211 ieee80211_regdom=PL
```

or pass cfg80211.ieee80211_regdom=PL as kernel parameter if the support is in the kernel image itself. Best is wireless support in modules I think.

That should not be enough to stop deauthentifications. I have some extra mac80211 module parameters that can try, obvioulsy, without any guarantee of success.

```
options mac80211 max_nullfunc_tries=60 max_probe_tries=60 probe_wait_ms=3600000
```

The kernel support for your wireless card could need some parameters to help. So, one or more kernel parameters for the wireless support can change it's behavior. I have very few wpa_supplicant.conf options. I keep those kernel parameters and I rarely see a deauthentification when I check the kernel logs.

----------

## N8Fear

Check if there are two or more instances of wpa_supplicant running. I have a similar problem due to dhcpcd spawning an own instance of wpa_supplicant (at least it seems like that's what's happening...)

----------

## fbcyborg

Hi!

Thanks for replying.

I only have one instance of wpa_supplicant.

I tried with the following option with no luck:

```
options cfg80211 ieee80211_regdom=IT
```

The strange fact is that if I try to connect to my HTC phone hotspot, I don't have any problem with it. So I guess it could depend on the network type used by my home access point. I don't think it should be anything strange as it is configured as WPA2-PSK security.

I've also tried the other option for mac mac80211, but the problem is still there.

Notice that I was a wicd user and I've switched to plasma-nm applet and NetworkManager recently, and I didn't have any connection issue with wicd before (at least as regard the first connection). So I don't think it could be a kernel module related problem.

Is there some other kind of check I could do, as regard the wireless network type?

EDIT: the network I'm trying to connect has a WPA2-PSK [AES] protection. When the plasma-nm prompts for the password request, I insert it but it can't connect. Could it be that the problem I am facing with is described into this bug?

----------

## Logicien

So, if Wicd is working with your home access point, it can be a NetworkManager configuration issue. You can go back to Wicd or try to understand how Wicd is configure and try to use a similar one with NetworkManager.

----------

## fbcyborg

Hey! I've finally found out the way to connect!

I clicked on Edit connection and set the BSSID to the MAC Address of the access point!

Really weird!  :Very Happy: 

----------

## GentilToo

 *fbcyborg wrote:*   

> Hey! I've finally found out the way to connect!
> 
> I clicked on Edit connection and set the BSSID to the MAC Address of the access point!
> 
> Really weird! 

 

Brilliant, just what I needed. Had the same error. How you came up with this solution is beyond me.

Anyway, thanks for posting.

----------

