# wpa_supplicant trying to start wrong interface on boot

## Splink

Hello, 

I recently did a new install and migrated to Systemd. Everything is fine, apart from one small glitch on boot.

When booting I get:

```
Apr 10 08:26:16 Asus wpa_supplicant[150]: Successfully initialized wpa_supplicant

Apr 10 08:26:16 Asus wpa_supplicant[150]: Could not read interface wlan0 flags: No such device

Apr 10 08:26:16 Asus wpa_supplicant[150]: WEXT: Could not set interface 'wlan0' UP

Apr 10 08:26:16 Asus wpa_supplicant[150]: wlan0: Failed to initialize driver interface

Apr 10 08:26:16 Asus systemd[1]: wpa_supplicant@wlan0.service: main process exited, code=exited, status=255/n/a

Apr 10 08:26:16 Asus systemd[1]: Unit wpa_supplicant@wlan0.service entered failed state.

Apr 10 08:26:17 Asus systemd[1]: Started WPA supplicant.

```

Although my interface config in conf.d/net is:

```

dns_domain_lo="homenetwork"

nis_domain_lo="home"

config_eth0="dhcp"

modules_wlp3s0=("wpa_supplicant dhclient")

iwconfig_wlp3s0+mode="Managed"

wpa_supplicant_wlp3s0="-Dnl80211 -c /etc/wpa_supplicant/wpa_supplicant.conf"

wpa_timeout_wlp3s0=30

config_wlp3s0="dhcp"

```

I am using Network Manager to start and my NetworkManager conf is:

```

[main]

plugins=keyfile

+dhcp=dhclient

[ifnet]

managed=true

auto_refresh=false

```

When the system boots, I run:

```

systemctl start wpa_supplicant@wlp3s0.service && dhclient -4 wlp3s0

```

And following this, everything works fine until the next reboot.

Am i right in guessing that Network Mangager initiating wpa_supplicant on boot is looking at the wrong interface? I need to change that to look at wlp3s0 instead of wlan0.

----------

## eccerr0r

I'm a bit confused here, it looks like you have both openrc and networkmanager configs...

Unfortunately I don't know enough of NM to help but the easiest way is to use the NetworkManager applet/GUI config and set your wireless interface to be auto-connect and available to all users, this would be the "networkmanager" way...

NetworkManager will call wpa supplicant automatically for you too, so you don't need to explicitly start it.

If someone could detail how to do this on the CLI I'd be interested...

----------

## Splink

Ahh I think you have pointed me to the problem here. 

It looks like NetworkManager is not calling WPA correctly, although it says it starts ok.

Basically it runs through boot and Network Manager, WPA_Supplicant are enabled in the startup. Network Manager starts, but in iwconfig there is no SSID connecting. 

Starting with commands brings the SSID up and connects with DHCP with no problems. This is a manual process though to failback on as Network Manager isnt doing anything. 

Anyway, when I run nm-applet I now get

```
(nm-applet:30984): nm-applet-WARNING **: Failed to initialize D-Bus: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.

(nm-applet:30984): GLib-GObject-CRITICAL **: Custom constructor for class NMApplet returned NULL (which is invalid).  Unable to remove object from construction_objects list, so memory was probably just leaked.  Please use GInitable instead.

```

So I think I will do some digging around about this as it looks like Network Manager cannot call dbus, although dbus is started in systemctl

```
dbus.service                 loaded active running   D-Bus System Message Bus

```

however in the journal its showing:

```
Apr 10 17:27:25 Asus dbus[157]: [system] Activating via systemd: service name='org.freedesktop.NetworkManager' unit='dbus-org.freedesktop.NetworkManager.service'

Apr 10 17:27:25 Asus dbus[157]: [system] Activation via systemd failed for unit 'dbus-org.freedesktop.NetworkManager.service': Unit dbus-org.freedesktop.NetworkManager.

Apr 10 17:27:25 Asus dbus-daemon[157]: dbus[157]: [system] Activation via systemd failed for unit 'dbus-org.freedesktop.NetworkManager.service': Unit dbus-org.freedeskt

```

So it looks like network cannot contact dbus because something is potentially missing.

----------

## Splink

Right, I managed to get NetworkManager working however it is not allowing me to connect to any SSID at all. Anyway after a little bit of reseach, I am going to re-emerge a few things and then see if this fixes the problem.

----------

## Splink

Nope its still broke. 

NetworkManager is sending deauth beacons on wifi, so it keeps trying to rejoin, then disconnect then rejoin, then disconnect etc. 

So ive checked if there is anything starting any networking interfaces and there is not, so disabling network manager and then going with my script on boot which works a treat.

----------

