Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
wpa_supplicant not called by dhcpcd at startup
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
TypicalGentooUser
n00b
n00b


Joined: 26 Sep 2020
Posts: 7

PostPosted: Sat Sep 26, 2020 8:12 pm    Post subject: wpa_supplicant not called by dhcpcd at startup Reply with quote

Hello, I want to make dhcpcd to auto connect using wpa_supplicant.
Currently I do it manually:
Code:
wpa_supplicant -i wlp2s0f0u7 -B -Dn180211,wext -c /etc/wpa_supplicant/wpa_supplicant.conf
dhcpcd wlp2s0f0u7

wpa_supplicant is already configured for home network.

dhcpcd is running at startup, but it doesn't use wpa_supplicant on interface that I mentioned.

My /etc/conf.d/net:

Code:
modules_wlp2s0f0u7="wpa_supplicant"
config_wlp2s0f0u7="dhcp"


And /etc/conf.d/wpa_supplicant:

Code:
wpa_supplicant_args="-B -M -c/etc/wpa_supplicant/wpa_supplicant.conf -Dn180211,wext"


P.S. will be even greater if it will auto connect any wlp* interface even if I plug adapter into different usb.

Please help!
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54244
Location: 56N 3W

PostPosted: Sat Sep 26, 2020 9:04 pm    Post subject: Reply with quote

TypicalGentooUser,

Welcome to Gentoo.

Your interface name is wlp2s0f0u7, which is renamed by udev from its kernel assigned name when it was discovered.
As you know, its USB slot dependent.
The same thing happens with ethernet interfaces. There are several ways to fix this.
1. Append
Code:
net.ifnames=0
to the kernel command line.
2. Create an empty udev rules file. It needs te have the right name.
They both stop udev doing the renaming of all network interfaces.

3. Write a udev rule that uses the udev visible properties of the device to assign a name of your choosing.
Do not use the kernel name sequence nor the udev sequence.

Your /etc/conf.d/net is correct.
Did you create the net.wlp2s0f0u7 symbolic link in /etc/init.d/ ?
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
DONAHUE
Watchman
Watchman


Joined: 09 Dec 2006
Posts: 7651
Location: Goose Creek SC

PostPosted: Sat Sep 26, 2020 10:10 pm    Post subject: Reply with quote

IIRC, dhcpcd stopped calling wpa_supplicant awhile back and direction was issued to add wpa_supplicant to default run level.
TypicalGentooUser wrote:
My /etc/conf.d/net:
But this suggests you may be trying to run gentoo default networking and dhcpcd as two simultaneous network managers.
If you use dhcpcd as a network manager dhcpcd and wpa_supplicant should be in the default run level and /etc/conf.d/net and the net. symlinks should be empty. If you use gentoo default networking (netifrc) use /etc/conf.d/net and the net. symlinks in the default run level dhcpcd and wpa_supplicant should not be in a run level.

wpa_supplicant.conf departs from example of manual
Code:
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=wheel

https://linux.die.net/man/5/wpa_supplicant.conf

https://wiki.gentoo.org/wiki/Netifrc
https://wiki.gentoo.org/wiki/Wifi
https://wiki.gentoo.org/wiki/Handbook:AMD64/Installation/Networking
https://wiki.gentoo.org/wiki/Wpa_supplicant
_________________
Defund the FCC.
Back to top
View user's profile Send private message
TypicalGentooUser
n00b
n00b


Joined: 26 Sep 2020
Posts: 7

PostPosted: Sun Sep 27, 2020 9:01 pm    Post subject: Reply with quote

NeddySeagoon wrote:
TypicalGentooUser,

Welcome to Gentoo.

Your interface name is wlp2s0f0u7, which is renamed by udev from its kernel assigned name when it was discovered.
As you know, its USB slot dependent.
The same thing happens with ethernet interfaces. There are several ways to fix this.
1. Append
Code:
net.ifnames=0
to the kernel command line.
2. Create an empty udev rules file. It needs te have the right name.
They both stop udev doing the renaming of all network interfaces.

3. Write a udev rule that uses the udev visible properties of the device to assign a name of your choosing.
Do not use the kernel name sequence nor the udev sequence.

Your /etc/conf.d/net is correct.
Did you create the net.wlp2s0f0u7 symbolic link in /etc/init.d/ ?


Yes, I did.

When I running openrc:

Code:

 * Bringing up interface wlp2s0f0u7
 *   Starting wpa_supplicant on wlp2s0f0u7 ...
Successfully initialized wpa_supplicant
ctrl_iface exists and seems to be in use - cannot override it
Delete '/var/run/wpa_supplicant/wlp2s0f0u7' manually if it is not used anymore
Failed to initialize control interface 'DIR=/var/run/wpa_supplicant GROUP=wheel'.
You may have another wpa_supplicant process already running or the file was
left by an unclean termination of wpa_supplicant in which case you will need
to manually remove this file before starting wpa_supplicant again.

nl80211: deinit ifname=wlp2s0f0u7 disabled_11b_rates=0
 *   start-stop-daemon: failed to start `/usr/sbin/wpa_supplicant'                                                                                                                            [ !! ]
 * ERROR: net.wlp2s0f0u7 failed to start


Needless to say that I tried to rerun it after killall wpa_supplicant; rm /var/run/wpa_supplicant/wlp2s0f0u7;
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum