Skip to content

Instantly share code, notes, and snippets.

@pojntfx
Last active June 16, 2021 20:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pojntfx/d323ade1305098d306980363237023ec to your computer and use it in GitHub Desktop.
Save pojntfx/d323ade1305098d306980363237023ec to your computer and use it in GitHub Desktop.
Dynamic Wifi configuration with iwd on Alpine Linux

Install and setup iwd and dbus

apk add iwd dbus
echo "[General]\nEnableNetworkConfiguration=true" >> /etc/iwd/main.conf
rc-service iwd start
rc-service dbus start
rc-update add iwd default
rc-update add dbus default

Connect to your desired wifi network

This can also be done interactively by typing just iwctl in your terminal.

Let's say that we want to connect to a network named "Felixs iPhone"; if this is your first time connecting to the network, you'll be prompted for the password:

iwctl station wlan0 connect "Felixs iPhone"

iwd will periodically scan for networks in the background, automatically connect and request an IP once it finds one which you've connected to before.

@HueRtx
Copy link

HueRtx commented Jun 16, 2021

thx bro
u helped me

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