bitflippin.com
Steven's personal website and bit flipping laboratory
2024-07-11

Wifi on Arch Linux

After installing Arch Linux and the iwd and openresolv packages, I set up wireless internet access on a Lenovo Thinkpad P52s.

These instructions configure and enable two services. The iwd service provides wireless internet access. The systemd-resolved service provides domain name resolution. These instructions also cover network configuration steps leftover from the minimal Arch installation.

Networking

On a single line in /etc/hostname assign the machine a hostname. For example the entire contents of the file could be MyHostname. Local applications can use the hostname to reference the machine.

vim /etc/hostname

Name resolution service

I tried extensively to get systemd-resolved working but could not get past an issue where many names resolved but some did not, including the name of this site for instance. I switched to resolvconf.

Per the Arch wiki, create the resolv.conf configuration file.

resolvconf -u

Wireless service

There is no iwd configuration file by default. Paste in this minimal configuration file when the time comes.

/etc/iwd/main.conf
[General]
EnableNetworkConfiguration=true

[Network]
NameResolvingService=resolvconf

Start and enable the iwd service. Starting the service launches it immediately. Enabling the servicec causes it to start automatically on boot. Connect to the internet wirelessly, replacing MyNetwork and MyPassphrase appropriately.

# Create the iwd config file
vim /etc/iwd/main.conf

# Start and enable iwd
systemctl enable iwd
systemctl start iwd

# Connect to a wireless network
iwctl --passphrase MyPassphrase station wlan0 connect MyNetwork

# Optionally view the network file that was created
cat /var/lib/iwd/MyNetwork.psk

Further wireless refinements are possible and likely desirable. The installation guides consulted contain additional network configuration recommendations I do not yet understand. Meanwhile these steps suffice to make the Arch installation usable.

References