# dhcpcd not called for wireless interface with wpa_supplicant

## simernes

Dear Gentoo community

I've followed the handbook and am able to boot into my install on disk. However, wpa_supplicant is for some reason not connecting properly. During the install the WiFi worked fine.

I have a card with RTL8188EE, for which I have selected the driver for in the kernel, and I can see the interface named as wlo1 in ifconfig.

I followed the wiki hints at https://wiki.gentoo.org/wiki/Wpa_supplicant/en replacing every entry of wlan0 with wlo1.

I can see in ifconfig that the wlo1 interface has

```
RX packets 1877 bytes 772463

TX packets 10 bytes 1192

```

with 0 errors and 0 of everything else.

My file /etc/wpa_supplicant/wpa_supplicant.conf at the moment only contains one network with the ssid and hashed psk

Additionally I have tried enabling logging as follows:

/etc/conf.d/net:

```
modules_wlo1="wpa_supplicant"

wpa_supplicant_wlo1="-Dnl80211 -d -f /var/log/wpa_supplicant.log"

config_wlo1="dhcp"

```

However no log file is created. I can see during startup that wpa_supplicant service is loaded, but I see no mention of wlo1. eno1 tries to dhcp but fails, as I have no ethernet cable connected.

When I try to run wpa_supplicant -Dnl80211 -iwlo1 -C/var/run/wpa_supplicant/ -c/etc/wpa_supplicant/wpa_supplicant.conf -dd I get a very long list of outputs, and at the end I see things like:

```
wlo1: WPA: Key negotioation completed with 00:xx:xx:xx:xx:xx [PTK=CCMP GTK=CCMP]

wlo1: Cancelling authentication timeout

wlo1: State: GROUP_HANDSHAKE -> COMPLETED

nl80211: Set wlo1 operstate 0->1 (UP)
```

....

So it looks like it is working?

After a while I also get wlo1: BSS: Remove id 1 BSSID .................

2

3

4

5

...

etc.

Now if I manually run dhcpcd wlo1 I get an IP. How can I enable that at startup?

[Moderator edit: added [code] tags to preserve output layout. -Hu]Last edited by simernes on Mon Mar 09, 2020 4:52 pm; edited 1 time in total

----------

## Hu

 *simernes wrote:*   

> /etc/conf.d/net:
> 
> ```
> modules_wlo1="wpa_supplicant"
> 
> ...

 Is this an accurate transcription of the file?  I would expect all the lines in the file to agree about the interface name, but as shown you use one name on the first line and a different name on the remaining lines.  This is likely to cause only the first line to be respected, since your interface is named wlo1, not wlan0.  In turn, that would mean your attempt to enable debug logging is ignored, as is your request that it start DHCP.  This would be consistent with your reported symptoms.  Please change the file to use the same name in all three lines, retry, and report back.

----------

## simernes

 *Hu wrote:*   

>  *simernes wrote:*   /etc/conf.d/net:
> 
> ```
> modules_wlo1="wpa_supplicant"
> 
> ...

 

My apologies, that was a badly edited copy paste from the wiki on my behalf. The config did in fact contain wlo1 in each instance (I've updated the question text).

----------

## Hu

Have you configured the init system to start that network device at boot?  What is the output of rc-update show | grep net?

----------

## simernes

 *Hu wrote:*   

> Have you configured the init system to start that network device at boot?  What is the output of rc-update show | grep net?

 

I removed the init.d file for the wlo1 device so that wpa_supplicant would take care of it as per the wiki, but maybe I should have added dhcpcd with rc-update as well? Anyways I don't think I'll bother too much with it now as I've got KDE running and I'm gonna use NetworkManager.

----------

## Hu

What do you see in the Wiki that makes you think that wpa_supplicant will either handle DHCP itself, or automatically run a DHCP client for you?  I read it as being that you can either start wpa_supplicant and dhcpcd, or you can let the net.* script start both for you.

----------

## Goverp

FWIW, my laptop uses wpa_supplicant and dhcpcd, but neither net.foo nor NetworkManager.  It's worked that way for ages.

Both wpa_supplicant and dhcpcd are in the default runlevel.

In case it helps, here's my /etc/conf.c/wpa_supplicant

```
# conf.d file for wpa_supplicant

#

# Please check man 8 wpa_supplicant for more information about the options

# wpa_supplicant accepts.

#

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

and /etc/wpa_supplicant/wpa_supplicant.conf

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

update_config=1

country=GB

network={

        ssid="foo"

        psk="bah"

        proto=RSN

        key_mgmt=WPA-PSK

        pairwise=CCMP

        auth_alg=OPEN

}
```

AFAIK my /etc/dhcpcd.conf is the unchanged default from installation.

I manage the networks with wpa_gui, part of wpa_supplicant package.

----------

