# Help me connect to the internet using wpa_supplicant

## LegionOfHell

I installed both wpa_supplicant and dhcpcd during installation...I set up wpa_supplicant following the Gentoo guide.

when I booted my system at first, after running ifconfig only the "lo" interface was showing, i installed the relevant kernel items and now "wlo1" is showing ...

When I tried to enable "Network support--> Wireless --> Default rate control algorithm (Minstrel)" a window poped with "(X) Minstrel" with a select and help button at the bottom, I chose select. Just wanted you to know.

"ip link show wlo1" returns something like this: 

3: wlo1: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN mode DEFAULT group default qlen 1000

wpa_cli returns an error saying: 

Interactive mode

could not connect to wpa_supplicant: (nil) - retrying

and then it hangs

dhcpcd wlo1 returns:

wlo1: waiting for the carrier

time out

dhcpcd exited

Please help!!

----------

## LegionOfHell

OK so I figured out how to get the internet working...

every time I reboot my computer I have to run the 2 following commands in order for internet to work: 

wpa_supplicant -B -M -c/etc/wpa_supplicant/wpa_s.conf

dhcpcd wlo1

But I have added wpa_supplicant to auto run using : rc-update add wpa_supplicant default 

And I have added wpa_supplicant_args="-B -M -c/etc/wpa_supplicant/wpa_s.conf" to /etc/conf.d/wpa_supplicant

I have also added: 

modules_wlo1="wpa_supplicant"

config_wlo1="dhcp"

to /etc/conf.d/net

Can someone tell me how to automate the process i mentioned in the beginning ? 

Many Thanks

--------------------------------------

I don't know if it is relevant but I installed my Gentoo from Ubuntu 19.04 live, the network interface wlo1 showed up there as well and I performed the following steps in the chroot environment inside ubuntu Live:

emerge --ask --noreplace net-misc/netifrc

cd /etc/init.d

ln -s net.lo net.wlo1

rc-update add net.wlo1 default

emerge --ask net-misc/dhcpcd

emerge --ask net-wireless/iw net-wireless/wpa_supplicant

--------------------------------------

I ran rc-update add dhcpcd default ... now after each reboot I only have to run:

wpa_supplicant -B -M -c/etc/wpa_supplicant/wpa_s.conf

after running the above . I get connected to the internet...don't have to type dhcpcd wlo1 anymore...seems like wpa_supplicant is not doing its job at boot...

----------

## charles17

You might want to read https://wiki.gentoo.org/wiki/Wpa_supplicant

----------

## LegionOfHell

I followed the guide .. the problem is wpa_supplicant doesn't do its job at boot ... I have to manually run this command after boot:

[code]wpa_supplicant -B -M -c/etc/wpa_supplicant/wpa_s.conf[/code]

----------

## NeddySeagoon

LegionOfHell,

You have missed  a step in your wifi setup.

The startup script will call wpa_supplicant then dhcpcd, if that's what you want.

----------

## LegionOfHell

I can't think of where I made a mistake...

My custom /etc/wpa_supplicant/wpa_s.conf has : 

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

update_config=1

eapol_version=1

ap_scan=1

fast_reauth=1

network={

               ssid="BELL138"

               psk="pass"

               priority=5

}

-----------------

My /etc/conf.d/wpa_supplicant has:

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

-----------------

I also added wpa_supplicant to the runlevel:

rc-update add wpa_supplicant default

----------------

My /etc/conf.d/net has: 

modules_wlo1="wpa_supplicant"

config_wlo1="dhcp"

---------------

wpa_supplicant runs at boot but it doesn't do anything...but once I run it manually after boot like this: 

wpa_supplicant -B -M -c/etc/wpa_supplicant/wpa_s.conf

connection establishes..can't think of what's going on...

----------

## Jaglover

 *Quote:*   

> rc-update add wpa_supplicant default 

 

What gave you this idea? wpa_supplicant is supposed to be called by net script or some network management tool you may have installed. And please use code tags to post code.

----------

## LegionOfHell

The handbook did : https://wiki.gentoo.org/wiki/Wpa_supplicant

check the section : "Setup for dhcpcd as network manager"

----------

## Jaglover

https://wiki.gentoo.org/wiki/Network_management_using_DHCPCD

----------

## LegionOfHell

I did as the guide says except I didn't do the section "Migration from Gentoo net.* scripts" should I go through that as well ?

----------

## NeddySeagoon

LegionOfHell,

Choose exactly one network management tool.

When you choose more, your WiFi will never connect as the management tools fight over wpa_supplicant.

dmesg will show a never ending cycle of attemtps to connect that end with disconnected Reason=3.

There are a handful of network management tools. All depend on wpa_supplicant being configured correctly.

All call wpa_supplicant in the course of making WiFi work.

We don't know what you have installed and configured.

----------

## LegionOfHell

I did as the "Migration from Gentoo net.* scripts" guide says: 

[code]

rc-update del net.wlo1

/etc/init.d/net.wlo1 stop

echo 'sys-apps/openrc -netifrc' >> /etc/portage/package.use/openrc

emerge --ask --newuse --oneshot sys-apps/openrc

emerge --ask --verbose --depclean net-misc/netifrc

rm /etc/conf.d/net

rm /etc/init.d/net.*

reboot

[/code]

However, I still have to run: 

[code]wpa_supplicant -B -M -c/etc/wpa_supplicant/wpa_s.conf[/code]

after login for wireless to get connected ... any ideas about what might be the problem ?

----------

## charles17

The start script /etc/init.d/wpa_supplicant seems to want  wpa_supplicant.conf, not wpa_s.conf.

Did you change it?

Does the WPA Supplicant Daemon get started at boot or when restarting it manually like this? 

```
rc-config restart wpa_supplicant
```

----------

## LegionOfHell

yep, wpa_s.conf was the culprit....now it's working fine...thank you

weird though because wpa_s.conf works when entering the following command after login:

wpa_supplicant -B -M -c/etc/wpa_supplicant/wpa_s.conf

----------

## NeddySeagoon

LegionOfHell,

-c says to use the file name that follows as the configuration file.

----------

