Part of the Arch Linux appeal is how minimal it is. With this minimalism comes adopting command-line tools to do the basic things we take for granted, like connecting to Wi-Fi.
While this isn’t necessarily the case if you install a desktop environment like GNOME or KDE, but it definitely comes into play during the installation of Arch Linux, which is as stripped down as it gets.
Since I don’t reinstall Arch very often, maybe once a year or so less, I tend to
forgot how to connect to the Internet during the initial setup. Previously this
was done with netctl
by way of the wifi-menu
command. It was straight
forward (execute it and run through the dialog), but doesn’t seem to be included
in the base image any longer.
What is included is the iNet wireless daemon (iwd
) which gives us the iwctl
command. Upon running iwctl
you are dropped into the iwd
interactive
prompt:
$ iwctl
[iwd]#
From the prompt you will need figure out your device name, and assuming you know the SSID of your wireless network, go ahead and connect like so:
[iwd]# device list
# You should see something like this:
#
# Devices
# -------------------------------------------------------------
# Name Address Powered Adapter Mode
# -------------------------------------------------------------
# wlan0 ... on ... ...
[iwd]# station YOURDEVICE connect YOURSSID
For a secured wireless network, you will be prompted for it and you’ll be off to the races!
Of course, if you don’t know the SSID for the network you’re connecting to, you can scan for available networks:
[iwd]# station YOURDEVICE scan
And when you’re all done and would like to disconnect, simply run:
[iwd]# station YOURDEVICE disconnect