Wiki homeEdit this page

WiFi connection with wpa_supplicant

Prerequisites

ip link set <interface> up
wpa_passphrase 'SSID' 'password' > /etc/wpa_supplicant/wpa_supplicant-<interface>.conf

NOTE: A complete documentation of all the possible options can be found here.

Using a script

wpa_supplicant -i <interface> -c /etc/wpa_supplicant/wpa_supplicant-<interface>.conf
wpa_supplicant -B -i <interface> -c /etc/wpa_supplicant/wpa_supplicant-<interface>.conf

Start the interface with dhcpcd.

dhcpcd <interface>

Check your connection.

ping getkiss.org

A way of automation could be to put this in a shell script.

#!/bin/sh
wpa_supplicant -B -i <interface> -c /etc/wpa_supplicant/wpa_supplicant-<interface>.conf
dhcpcd <interface>

Using dhcpcd hooks

ln -s /usr/share/dhcpcd/hooks/10-wpa_supplicant /usr/libexec/dhcpcd-hooks/

Check your connection.

ping getkiss.org