Skip to main content
Topic: custom eth0 wpa_supplicant service (Read 704 times) previous topic - next topic
0 Members and 3 Guests are viewing this topic.

custom eth0 wpa_supplicant service

Hi everyone,

I want to only rely on wpa_supplicant for managing internet connections, so I got rid of NetworkManager and transferred all my connections in my wpa_supplicant.conf. Then, I obviously added wpa_supplicant and dhcpcd to runlevel default in OpenRC (I use Artix OpenRC).

However, the "default" wpa_supplicant OpenRC daemon (shipped through "wpa_supplicant-openrc") doesn't seem to work for my wired connection (despite working flawlessly for each other wireless connection in my wpa_supplicant.conf).

In order to connect to the internet through my wired connection, I have to stop the wpa_supplicant and dhcpcd services, kill every instance of them running, and then run:

sudo wpa_supplicant -B -i eth0 -c /etc/wpa_supplicant/wpa_supplicant.conf -D wired -d -f ~/wpa.log


(I included the debug flags) and

sudo dhcpcd eth0

Then, it connects. To make sure it's actually connecting to my wired network, i commended-out all other networks from my wpa_supplicant.conf and disabled wifi via rfkill.

How may I "automate" connection to my wired network when I turn on my laptop?  Do I have to write a custom OpenRC script?
What I would like to happen, is my laptop always connecting to the wired connection if available, switching to wireless if it's not.
I know there are a few people in the forum actively using wpa_supplicant to manage connections, so feel free to share any hint or suggestion. I'm here to learn :)

Re: custom eth0 wpa_supplicant service

Reply #1
EDIT: I inspected the wpa_supplicant service conf file in /etc/conf.d/wpa_supplicant. It doesn't seem to pass any flag to wpa_supplicant as it is, but nonethless this seems to be sufficient to manage wireless networks:

Code: [Select]
# conf.d file for wpa_supplicant

# uncomment this if wpa_supplicant starts up before your network interface
# is ready and it causes issues
# rc_want="dev-settle"

# Please check man 8 wpa_supplicant for more information about the options
# wpa_supplicant accepts.
#
wpa_supplicant_args=""

Should I edit this file?

EDIT: I unintentionally replied to the post multiple times. Moderators can delete these replies

Re: custom eth0 wpa_supplicant service

Reply #2
Hi everyone,

I want to only rely on wpa_supplicant for managing internet connections, so I got rid of NetworkManager and transferred all my connections in my wpa_supplicant.conf. Then, I obviously added wpa_supplicant and dhcpcd to runlevel default in OpenRC (I use Artix OpenRC).

However, the "default" wpa_supplicant OpenRC daemon (shipped through "wpa_supplicant-openrc") doesn't seem to work for my wired connection (despite working flawlessly for each other wireless connection in my wpa_supplicant.conf).

In order to connect to the internet through my wired connection, I have to stop the wpa_supplicant and dhcpcd services, kill every instance of them running, and then run:

sudo wpa_supplicant -B -i eth0 -c /etc/wpa_supplicant/wpa_supplicant.conf -D wired -d -f ~/wpa.log


(I included the debug flags) and

sudo dhcpcd eth0

Then, it connects. To make sure it's actually connecting to my wired network, i commended-out all other networks from my wpa_supplicant.conf and disabled wifi via rfkill.

How may I "automate" connection to my wired network when I turn on my laptop?  Do I have to write a custom OpenRC script?
What I would like to happen, is my laptop always connecting to the wired connection if available, switching to wireless if it's not.
I know there are a few people in the forum actively using wpa_supplicant to manage connections, so feel free to share any hint or suggestion. I'm here to learn :)

I have basically done the exact same thing, got rid of connman and use something much simpler that basically acts as a frontend for wpa_supplicant.

I have a program that will automatically connect to a wifi network either based on priority, whatever it finds in /etc/wpa_supplicant or just giving it a manual SSID.

And the best part: it's a shell script program, meaning it's completely init independent.

Would you be interested in seeing it?

Re: custom eth0 wpa_supplicant service

Reply #3
I have basically done the exact same thing, got rid of connman and use something much simpler that basically acts as a frontend for wpa_supplicant.

I have a program that will automatically connect to a wifi network either based on priority, whatever it finds in /etc/wpa_supplicant or just giving it a manual SSID.

Would you be interested in seeing it?

Yes totally! Thank you! :D

EDIT: it seems like the default wpa_supplicant init script is intended to only manage wireless networks, so at least the reason for failure is now clear.