You are not logged in.

#1 2019-02-28 13:19:22

chrisdb
Member
From: Belgium
Registered: 2018-05-16
Posts: 155

[SOLVED] Autostart wireless interface without manager

hi,

I want to setup my wifi as simple as possible without some sort of manager.
So I'm using 'wpa_supplicant' in combination with 'dhcpcd'.

What is the easiest/fastest way to enable my wireless interface at boot (ip link set wlp1s0 up) before wpa_supplicant and dhcpcd are run?

Thx!

Last edited by chrisdb (2019-03-02 10:13:48)


Failure is success in progress.
A.E.

Offline

#2 2019-02-28 13:24:48

ayekat
Member
Registered: 2011-01-17
Posts: 1,590

Re: [SOLVED] Autostart wireless interface without manager

There is no need to do `ip link set {netif} up`, wpa_supplicant should handle that.

What have you tried so far?


pkgshackscfgblag

Offline

#3 2019-02-28 13:39:41

chrisdb
Member
From: Belgium
Registered: 2018-05-16
Posts: 155

Re: [SOLVED] Autostart wireless interface without manager

ayekat wrote:

There is no need to do `ip link set {netif} up`, wpa_supplicant should handle that.

What have you tried so far?

I'm currently using netctl, but I was thinking of just using 'wpa_supplicant' and 'dhcpcd' because it would require less setup
during a new installation and maybe increase boot time...

I thought the interface needed to be setup first, as indicated on the Wiki:
'Activate the interface' comes before 'Connect to an access point'

The steps I would try during a new installation are the following:

wpa_passphrase "$ssid" "$wpa_key" > /etc/wpa_supplicant/wpa_supplicant-wlp1s0.conf
systemctl enable wpa_supplicant@wlp1s0
systemctl enable dhcpcd@wlp1s0

So basically this would be enough?


Failure is success in progress.
A.E.

Offline

#4 2019-02-28 13:45:58

ayekat
Member
Registered: 2011-01-17
Posts: 1,590

Re: [SOLVED] Autostart wireless interface without manager

That looks fine to me, yes.

chrisdb wrote:

I thought the interface needed to be setup first, as indicated on the Wiki:
'Activate the interface' comes before 'Connect to an access point'

Yes, but those subsections are in the iw section, not in the WPA2 section, so they don't apply to wpa_supplicant. smile

Last edited by ayekat (2019-02-28 13:47:14)


pkgshackscfgblag

Offline

#5 2019-02-28 14:16:54

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,532
Website

Re: [SOLVED] Autostart wireless interface without manager

I prefer just enabling the wpa_supplicant hook of dhcpcd, then the only systemd service you need to enable is dhcpcd@wlp1s0.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#6 2019-02-28 20:01:39

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 7,732
Website

Re: [SOLVED] Autostart wireless interface without manager

I use this custom unit file to bring the interface up, start wpa_supplicant and assign the IP addresses:

https://raw.githubusercontent.com/Head- … 40.service

No need for dhcpcd then smile

That's for Debian though so perhaps swap /sbin/$command for /usr/bin/$command and also adjust the addresses to suit your network, obviously — use `ip r` to check the addresses assigned by dhcpcd and copy those if you're not sure (the "default via" address should be for your router).

Usage example:

# systemctl enable --now network-wireless@wlp1s0

Note that the interface must be set down before the unit file is started or it will fail.

Last edited by Head_on_a_Stick (2019-02-28 20:04:22)

Offline

#7 2019-03-02 10:11:52

chrisdb
Member
From: Belgium
Registered: 2018-05-16
Posts: 155

Re: [SOLVED] Autostart wireless interface without manager

ayekat wrote:

That looks fine to me, yes.

Thx indeed that was enough

I'll also be looking into the other propositions from Trilby and Head_on_a_Stick , but for now this seems to be the easiest way...


Failure is success in progress.
A.E.

Offline

Board footer

Powered by FluxBB