# [SOLVED] wpa_supplicant Deauthentication problem

## bebyx

I just installed Gentoo to my old laptop Packard Bell Easynote MS2300.

Everything seems to work fine, except for the wireless connection with Qualcomm Atheros wireless card (driver ath9k).

While installing, I easily connected to Wi-Fi with 2 terminal commands like:

```
wpa_passphrase ssid passwd > /etc/wpa_supplicant/wpa_supplicant.conf
```

and 

```
wpa_supplicant -B -i wlp5s0 -c /etc/wpa_supplicant/wpa_supplicant.conf
```

But once rebooted into the installed system, I got problems. Wpa_supplicant says it is initialized successfully, but Internet isn't working.

I looked into dmesg and found out that it automatically deauthenticated for Reason 2: "Previous authentication no longer valid" - right after authentification.

I use dhcpcd and it doesn't get any IP info (since, I believe, there is no connection).

I would appreciate any clues. Maybe, I lack some drivers. Maybe, I should enable simple wired Ethernet card? (I didn't do that since I don't use it.) I was trying to solve this for two days already and have no progress and couldn't find similar problem topics.

Thanks in advance.Last edited by bebyx on Sat Mar 28, 2020 5:18 pm; edited 1 time in total

----------

## bebyx

Now I unmerged netifrc.

The wpa_supplicant is already in init.d, but I also added dhcpcd as per this article.

I restart /etc/init.d/wpa_supplicant - ok.

But when I restart /etc/init.d/dhcpcd it restart and then starts "Mounting network filesystems", which last like forever. Should I just try and wait for some time? Or is it an error?

When I try debugging mode with 

```
dhcpcd -dB
```

, it says that wlp5s0 is waiting for carrier. so seems like the problem is with connection and dhcp just can't get proper info from Wifi router.

----------

## Jaglover

bebyx,

look at the upper right corner of this page. There are four links. One reads: "View unanswered posts". You replied to your own thread and effectively decreased the visibility of your problem.

 *Quote:*   

> Now I unmerged netifrc.

 

This was a bad idea. Did you even look what is in that package before removing it?

You are not providing any logs, thus it has to be a guesswork from our side ... I guess you have more than one network management service activated, these are conflicting with each other.

----------

## bebyx

 *Jaglover wrote:*   

>  *Quote:*   Now I unmerged netifrc. 
> 
> This was a bad idea. Did you even look what is in that package before removing it?
> 
> You are not providing any logs, thus it has to be a guesswork from our side ... I guess you have more than one network management service activated, these are conflicting with each other.

 

I also think so (regarding network management), that's why I unmerged netifrc and removed /etc/init.d/net, as per this advice. I was hoping it would fix the issue, but nothing changed.

The output of dmesg is:

https://i.imgur.com/qEl1780.jpg

----------

## charles17

 *bebyx wrote:*   

> Now I unmerged netifrc.
> 
> The wpa_supplicant is already in init.d, but I also added dhcpcd as per this article.

 

Then you also have correct settings in /etc/conf.d/wpa_supplicant, including the -M option??

 *bebyx wrote:*   

> I restart /etc/init.d/wpa_supplicant - ok.
> 
> But when I restart /etc/init.d/dhcpcd it restart and then starts "Mounting network filesystems", 

 

Are you having any network file systems to be mounted?  If not remove that initd from the runlevels.

----------

## bebyx

I looked into rc-config list and saw some netmount which starts by default. Is it a netifrc service? I made rc-update del netmount default, and deleted netmount in conf.d and init.d files. Still not working inet.

----------

## bebyx

 *charles17 wrote:*   

> Then you also have correct settings in /etc/conf.d/wpa_supplicant, including the -M option??
> 
> 

 

Yes, I do. It's 

```
wpa_supplicant_args="-B -M -c/etc/wpa_supplicant/wpa_supplicant.conf"
```

The wpa_supplicant.conf file has

```

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=users

update_config=1

country=UA

network={

               ssid="myssid"

               #psk="mypsk"

               psk=numbers

               key_mgmt=WPA-PSK

}

```

Maybe, I need to change something there.

----------

## bebyx

Also removed net-online service from d folders and rc-config, but no result.

----------

## charles17

This is your chance to make friends with /etc/rc.conf

```
# Set rc_interactive to "YES" and you'll be able to press the I key during

# boot so you can choose to start specific services. Set to "NO" to disable

# this feature. This feature is automatically disabled if rc_parallel is

# set to YES.

#rc_interactive="YES"

```

Uncomment it and do a reboot interactively and you should see where it's hanging

----------

## bebyx

 *charles17 wrote:*   

> This is your chance to make friends with /etc/rc.conf
> 
> ```
> # Set rc_interactive to "YES" and you'll be able to press the I key during
> 
> ...

 

Thanks for a good tip, but unfortunately I couldn't detect anything suspicious except netmount which I skipped. Still not working.

----------

## charles17

 *bebyx wrote:*   

> Thanks for a good tip, but unfortunately I couldn't detect anything suspicious except netmount which I skipped. Still not working.

 

What exact error message?

----------

## bebyx

 *charles17 wrote:*   

>  *bebyx wrote:*   Thanks for a good tip, but unfortunately I couldn't detect anything suspicious except netmount which I skipped. Still not working. 
> 
> What exact error message?

 

Dmesg shows the same deauthentification for Reason 2. Ip link shows No carrier and state DOWN mode DORMANT.

----------

## charles17

Please wgetpaste the full dmesg output

Is the ... then starts "Mounting network filesystems", error gone?  Or still exists?

Have you worked through the wifi article?

----------

## bebyx

 *charles17 wrote:*   

> Please wgetpaste the full dmesg output
> 
> Is the ... then starts "Mounting network filesystems", error gone?  Or still exists?
> 
> Have you worked through the wifi article?

 

Mounting network filesystems doesn't show since I skip netmount service.

Do you think I could miss something in my kernel?

----------

## bebyx

I added ath9k driver as module and added AES cipher options. Rebuilt, rebooted, nothing changed.

----------

## bebyx

It finally worked!

I readded info to wpa_supplicant.conf according to this topic and it finally starts pinging.

Thanks to everyone who helped me with that. Finally will set my emvironment.

----------

## charles17

 *bebyx wrote:*   

> It finally worked!
> 
> I readded info to wpa_supplicant.conf according to this topic and it finally starts pinging.

 

Why edit that file manually while wpa_cli  exists?

----------

## bebyx

 *charles17 wrote:*   

>  *bebyx wrote:*   It finally worked!
> 
> I readded info to wpa_supplicant.conf according to this topic and it finally starts pinging. 
> 
> Why edit that file manually while wpa_cli  exists?

 

Because... I haven't got myself acquainted with wpa_cli. But thanks for the clue. That's just a matter of time.   :Smile: 

----------

