Skip to content

Instantly share code, notes, and snippets.

@okanon
Last active June 29, 2024 01:49
Show Gist options
  • Save okanon/d8469d76079782501b09c67e8d5ee04b to your computer and use it in GitHub Desktop.
Save okanon/d8469d76079782501b09c67e8d5ee04b to your computer and use it in GitHub Desktop.
AlpineLinux with wlan settings

AlpineLinux with wlan settings.

Install necessary drivers and software

First make sure your wireless drivers are loaded properly.
Install wpa_supplicant & dhcpcd.

apk add wpa_supplicant dhcpcd

Configuration

Use the interface to scan for wireless access points. Make sure the ESSID you want to connect to appears here.

iwlist wlan0 scanning | grep ESSID

Create a wpa_supplicant configuration stanza for the wireless access point.

wpa_passphrase 'YourRouterESSID' 'YourRouterPassword' > /etc/wpa_supplicant/wpa_supplicant.conf

Start wpa_supplicant in the foreground to make sure the connection succeeds.

wpa_supplicant -i wlan0 -c /etc/wpa_supplicant/wpa_supplicant.conf

If all is well, run it as a daemon in the background by setting the -B option.

wpa_supplicant -B -i wlan0 -c /etc/wpa_supplicant/wpa_supplicant.conf

Automatic Configuration on System Boot

Add a stanza for the desired interface (e.g. wlan0) to /etc/network/interfaces:

# /etc/network/interfaces

auto wlan0
iface wlan0 inet dhcp
    wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

Add configure /etc/wpa_supplicant/wpa_supplicant.conf

# /etc/wpa_supplicant/wpa_supplicant.conf

country=JP
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev

Make sure /etc/wpa_supplicant/wpa_supplicant.conf is the correct configuration for the wireless access point you want to connect to.
Bring the interface down.

ifconfig wlan0 down

Manually start wpa_supplicant.

/etc/init.d/wpa_supplicant start

If all is well (confirm with the sanity checks in Manual Configuration), configure wpa_supplicant to start automatically on boot.

rc-update add wpa_supplicant boot

Note: If this errors with ioctl 0x8914 failed: No error information, that's busybox ip's way of saying your wireless radio is rfkill'd. See here for information on how to unblock your wireless radio; the base installation should have busybox rfkill available.

@FlorianHeigl
Copy link

the first step needs to be

apk add wpa_supplicant dhcpcd wireless-tools

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment