Arch Linux It is renowned for its flexibility and minimalism, but these same qualities often become an obstacle for beginners, especially when it comes to basic tasks - such as connecting to Wi-Fi. Unlike distributions with graphical utilities like Ubuntu or MintHere, everything has to be configured manually. However, it's not as difficult as it seems!
In this article, you'll find step-by-step instructions with commands, explanations, and solutions to common problems. We'll cover two main methods: iwctl (recommended method for newer versions) and classic wpa_supplicantAnd if you encounter an error Device not ready or the adapter is not detected - we have a separate section with diagnostics.
Before you begin, make sure your Wi-Fi adapter is supported by the Linux kernel. This only requires one command—we'll cover it in the first section.
1. Checking the Wi-Fi adapter in Arch Linux
The first step is to ensure that the system actually "sees" your wireless adapter. Without this, all further steps are pointless. Enter the following in the terminal:
ip link
In the output, look for an interface with a name like wlan0, wlp3s0 or something similar. If this isn't the case, the adapter is either disabled or not supported. Check the physical connection (for USB adapters) or the Wi-Fi switch on your laptop.
If the interface is there but marked as DOWN, activate it:
sudo ip link set wlan0 up
Replace wlan0 to your real interface. If the command returned an error Operation not permitted, try with rfkill:
sudo rfkill unblock wifi
⚠️ Attention: On some laptops (especially Lenovo And HP) Wi-Fi is blocked by a hardware switch or key combination (eg. Fn+F2). Check this before setting up!
If the adapter isn't detected at all, install the driver package. For most modern chips Intel, Broadcom or Realtek will fit:
sudo pacman -S linux-firmware
2. Connecting via iwctl (recommended method)
Utility iwctl — part of the package iwd (iNet Wireless Daemon), which in Arch Linux often used by default instead wpa_supplicantIt is easier to use and better integrated with systemd.
First make sure that iwd installed and running:
sudo pacman -S iwd
sudo systemctl enable --now iwd
Now start the interactive mode iwctl:
sudo iwctl
Inside the utility, run the following commands (replacing the names with your own):
device list- will show available adapters (for example,wlan0).station wlan0 scan— scans networks.station wlan0 get-networks— displays a list of found networks.station wlan0 connect "Network_Name"- connects to the network (if it is open).
For secure networks (WPA/WPA2) after the command connect The utility will ask for a password. If the connection is successful, you will see a message Connected.
To check your connection, log out iwctl (team exit) and run:
ping -c 3 archlinux.org
Make sure iwd is installed and running
Run iwctl as root
Find your adapter with the device list command.
Scan networks and connect to the desired one
Check ping after connecting-->
3. Connecting via wpa_supplicant (alternative method)
If iwd for some reason it is not suitable (for example, your adapter does not support it), use the classic one wpa_supplicantThis method is universal, but requires manual editing of the configuration file.
First, install the required packages:
sudo pacman -S wpa_supplicant dialog
Now generate a config for your network. The easiest way is to use wpa_passphrase:
wpa_passphrase "NetworkName" "Password" | sudo tee /etc/wpa_supplicant/wpa_supplicant.conf
Open the file for editing and add the following line to the beginning:
ctrl_interface=/run/wpa_supplicant
Save the file and run wpa_supplicant in the background:
sudo wpa_supplicant -B -i wlan0 -c /etc/wpa_supplicant/wpa_supplicant.conf
Now get IP address via dhcpcd:
sudo dhcpcd wlan0
⚠️ Attention: If the Internet does not work after connecting, check if the firewall is blocking it (ufw or iptables) traffic. Also, make sure that the MAC address filter is not enabled on your router.
What to do if wpa_supplicant does not connect?
If the team wpa_supplicant returns an error Failed to initialize driver interface, try specifying the driver explicitly:
sudo wpa_supplicant -B -i wlan0 -D nl80211 -c /etc/wpa_supplicant/wpa_supplicant.conf
For older adapters (e.g. on chips) Broadcom) a driver may be required wext instead of nl80211.
4. Setting up automatic connection at boot
To avoid entering commands every time you turn on your computer, set up autostart iwd or wpa_supplicant through systemd.
For iwd (if you use it):
sudo systemctl enable --now iwd
For wpa_supplicant create a service:
sudo nano /etc/systemd/system/wpa_supplicant@.service
Insert the following text (replace wlan0 to your interface):
[Unit]Description=WPA supplicant daemon
Before=network.target
After=dbus.service
[Service]
Type=simple
ExecStart=/usr/bin/wpa_supplicant -u -i %I -c /etc/wpa_supplicant/wpa_supplicant.conf
[Install]
WantedBy=multi-user.target
Save the file and activate the service:
sudo systemctl enable wpa_supplicant@wlan0.service
sudo systemctl start wpa_supplicant@wlan0.service
To obtain IP automatically, add dhcpcd to startup:
sudo systemctl enable --now dhcpcd@wlan0.service
| Method | Advantages | Flaws |
|---|---|---|
iwd |
Easier to set up, better integration with systemd, supports modern protocols (WPA3) |
May not support older adapters |
wpa_supplicant |
Universal, works with almost all adapters | Requires manual editing of configs, more difficult to configure |
NetworkManager |
Graphical interface, VPN support, easy to use | Heavy for minimalist systems, not always stable |
5. Solving common problems
Even after proper setup, the connection may not work. Here are common errors and their solutions:
- 🔌 The adapter is not detected: Check the output
lspci | grep -i networkorlsusb(for USB adapters). If the device is present but not working, install the driver (for example,broadcom-wl-dkmsfor chips Broadcom). - 🔒 Authentication error: Make sure you enter the password correctly (case sensitive!). For networks with
802.1X(corporate) will require additional configurationwpa_supplicant. - 📡 Network not found: Check if the router is in the enabled mode.
802.11n/ac/ax(Sometimes older adapters don't see networks using modern standards.) Try manually specifying the channel:sudo iw dev wlan0 set channel 6. - 🔄 Constant connection breaks: There might be a problem with power saving. Disable it:
sudo iw dev wlan0 set power_save off.
If there is no internet access after connecting, check the routes:
ip route
Missing a default route? Add one manually:
sudo ip route add default via 192.168.1.1
Replace 192.168.1.1 to your router's IP.
6. Using NetworkManager (graphical interface)
If the command line seems too complicated, install NetworkManager - It provides a graphical interface for managing networks (including Wi-Fi). This is especially convenient for GNOME, KDE or Xfce.
Installation:
sudo pacman -S networkmanager
Launch and add to startup:
sudo systemctl enable --now NetworkManager
A network icon should now appear in the system tray (next to the clock). Click it, select your network, enter the password, and you're all set!
If there is no icon, install the applet for your graphical environment. For example, for KDE Plasma:
sudo pacman -S plasma-nm
For GNOME:
sudo pacman -S nm-applet
⚠️ Attention: NetworkManager may conflict withiwdorwpa_supplicantBefore installing it, disable other services:sudo systemctl disable --now iwd wpa_supplicant dhcpcd
7. Checking the connection speed and stability
Once connected, make sure the network is working properly. Check the speed using speedtest-cli:
sudo pacman -S speedtest-cli
speedtest-cli
To monitor stability, use ping with log:
ping -i 5 archlinux.org | tee ping.log
This command will send a packet every 5 seconds and write the results to a file ping.logIf you see high latency (e.g., >200 ms) or packet loss, the problem may be with your router or interference on the channel.
To check the signal strength, use:
iw dev wlan0 link
Look for the line signal. Meaning -30 dBm - excellent signal, -70 dBm - weak (breaks are possible).
8. Security: How to protect your connection
Wi-Fi in Arch Linux It's configured manually, giving you more control over security. Here are some tips:
- 🔐 Disable WPS: This protocol is vulnerable to brute-force attacks. Find the option in your router.
WPSand deactivate it. - 🛡️ Use WPA3: If your adapter and router support
WPA3, select it insteadWPA2. INwpa_supplicant.confadd a lineproto=RSNAndkey_mgmt=SAE. - 🕵️ Hide SSID: This isn't a panacea, but it will reduce the number of accidental connections. Enable the option in your router.
Hide SSID. - 🔄 Update your router firmware regularly: Router vulnerabilities are one of the main causes of data leaks.
To check who is connected to your network, use:
sudo arp-scan --localnet
Install arp-scan through pacman, if it's not there. Compare the MAC addresses in the output with the list of allowed devices in the router.
IN Arch Linux There is no firewall by default, so after connecting to Wi-Fi, install it immediately ufw and set up the rules:
sudo pacman -S ufwsudo ufw enable
sudo ufw default deny incoming
sudo ufw default allow outgoing
FAQ: Frequently Asked Questions about Wi-Fi in Arch Linux
My Wi-Fi adapter isn't detected. What should I do?
First, check if the adapter is visible in the system:
lspci -k | grep -A 3 -i network
If the device is present but the driver is not loaded (line Kernel driver in use: none), install the appropriate package. This will work for most chips. linux-firmware. For Broadcom may be needed broadcom-wl-dkms (from AUR).
If the adapter is USB, check this:
lsusb
Look for lines with Wireless or NetworkFor popular chips Realtek (For example, rtl8188eu) there are drivers in AUR: rtl8188eu-dkms-git.
How to connect to Wi-Fi without a password (open network)?
For iwctl just run:
station wlan0 connect "Network_Name"
For wpa_supplicant add in /etc/wpa_supplicant/wpa_supplicant.conf block:
network={ssid="Network_Name"
key_mgmt=NONE
}
Then restart the service:
sudo systemctl restart wpa_supplicant@wlan0
Is it possible to connect to Wi-Fi without root access?
Yes, but you need to set it up first. wpa_supplicant or iwd to work on behalf of a user. The easiest way is to add your user to a group network:
sudo usermod -aG network $USER
Then reboot. After that, commands like iwctl will work without sudo.
For NetworkManager it's enough to run it with the flag --no-daemon from user:
nmcli dev wifi connect "Network_Name" password "password"
How do I change DNS servers after connecting?
By default, DNS is taken from the router, but you can specify your own (for example, 1.1.1.1 from Cloudflare or 8.8.8.8 from Google). Edit the file /etc/resolv.conf:
sudo nano /etc/resolv.conf
Add the following lines:
nameserver 1.1.1.1
nameserver 8.8.8.8
To make changes persist after reboot, set openresolv:
sudo pacman -S openresolv
And set it up dhcpcd to use static DNS by adding /etc/dhcpcd.conf:
static domain_name_servers=1.1.1.1 8.8.8.8
Why is Wi-Fi slow?
There may be several reasons:
- Congested channel: Check what channels neighboring networks are using (command
sudo iwlist wlan0 scanning | grep Channel). Change the channel in your router settings to a less crowded one (for example, 1, 6, or 11 for 2.4 GHz). - Old standard: If the router is operating in mode
802.11b/g, the speed will be limited to 54 Mbps. Switch to802.11n(orac/ax, if supported). - Interference: Devices like microwaves or cordless phones can cause interference. Try switching to the 5 GHz band (if supported).
- Driver limitations: Some drivers (for example, for chips Realtek) have software limitations. Check the kernel log:
dmesg | grep wlan0.
It's also worth checking your router's QoS settings—sometimes speed limits are set there.