wpa_supplicant is the open-source supplicant daemon that authenticates a Linux machine to a wireless or wired network protected by WPA, WPA2, WPA3 or IEEE 802.1X. In Linux networking, it is the component that scans for access points, selects a network, performs the cryptographic key exchange and installs the resulting encryption keys in the kernel driver, so that ordinary traffic can flow.
The daemon does not assign IP addresses or manage routes. It establishes the secured link layer only, and another tool such as NetworkManager, systemd-networkd or a DHCP client configures addressing afterwards. Desktop environments usually hide it behind NetworkManager, while servers, embedded devices and minimal installations often configure it directly.
How wpa_supplicant secures a wireless link
In IEEE terminology, a supplicant is the client side of an authentication exchange, the authenticator is the access point or switch, and an optional authentication server, usually RADIUS, verifies credentials. wpa_supplicant implements the supplicant role defined by IEEE 802.11i and IEEE 802.1X.
After association, the access point and the client derive a Pairwise Master Key (PMK), either from a shared passphrase or from a successful EAP exchange. The four-way handshake then proves that both sides hold the PMK and derives fresh session keys, which wpa_supplicant passes to the kernel through the nl80211 interface. Group keys for broadcast traffic are distributed in a separate group key handshake and refreshed periodically.
The process of reaching a usable connection runs through distinct stages.
| Stage | What happens | Typical failure sign |
|---|---|---|
| Scan | Collects nearby networks and their security capabilities | Network not found |
| Selection | Matches results against configured network blocks | Wrong SSID or priority |
| Association | Joins the chosen access point | Association rejected |
| Authentication | Runs SAE or EAP to establish the PMK | Wrong password or certificate error |
| Four-way handshake | Derives and installs session keys | Handshake timeout |
| Completed | Encrypted link ready for IP configuration | No address until DHCP runs |
Supported security modes and key management
The key_mgmt option in each network block tells wpa_supplicant which authentication method to use. Home networks normally rely on a passphrase, while enterprise and campus networks use EAP with individual credentials or certificates.
| Value | Security mode | Credential | Notes |
|---|---|---|---|
WPA-PSK | WPA2-Personal | Passphrase or 256-bit PSK | Vulnerable to offline guessing if weak |
SAE | WPA3-Personal | Password | Resists offline dictionary attacks |
WPA-EAP | WPA2 or WPA3-Enterprise | Certificate or username | Requires a RADIUS server |
OWE | Enhanced Open | None | Encrypts open networks without authentication |
NONE | Open or legacy WEP | None or static key | Avoid on any sensitive network |
WPA3 also requires Protected Management Frames, controlled by the ieee80211w option, which prevents forged deauthentication frames. A transition mode configuration such as key_mgmt=SAE WPA-PSK lets one profile work with both WPA3 and older WPA2 access points.
For enterprise networks, the eap option selects the method, and the most frequent choices are EAP-TLS, PEAP and EAP-TTLS. Supplying a ca_cert is essential, because without it the client cannot verify the server and an attacker can operate a rogue access point that captures credentials.
Configuration file and control interface
wpa_supplicant reads a plain-text configuration file, commonly /etc/wpa_supplicant/wpa_supplicant.conf, containing global settings followed by one network block per known network. The utility wpa_passphrase converts an SSID and passphrase into a precomputed 256-bit PSK, derived with PBKDF2 over 4,096 iterations, so the clear-text password does not need to remain in the file.
At run time, the daemon exposes a control interface socket, typically under /run/wpa_supplicant, and a D-Bus API. The command-line client wpa_cli uses the socket to scan, add networks, reconnect and read status, while NetworkManager drives the daemon over D-Bus. With update_config=1, changes made through wpa_cli can be saved back to the file.
The most important options and flags are summarized below.
| Option or flag | Meaning | Example |
|---|---|---|
-i | Network interface to manage | -i wlan0 |
-c | Path to the configuration file | -c /etc/wpa_supplicant/wpa_supplicant.conf |
-D | Driver backend | -D nl80211 or -D wired |
-B | Run in the background as a daemon | -B |
ctrl_interface | Location of the control socket | /run/wpa_supplicant |
country | Regulatory domain for allowed channels | country=US |
priority | Preference among several known networks | priority=10 |
How wpa_supplicant relates to other Linux networking tools
wpa_supplicant sits between the kernel driver and the address configuration layer, and most confusion comes from expecting it to do the job of a neighboring tool. The iw utility configures radio parameters and can join only open networks, while NetworkManager and systemd-networkd handle addresses, routes and DNS.
| Tool | Main responsibility | Relationship to wpa_supplicant |
|---|---|---|
| iw | Radio and interface settings through nl80211 | Complements it; no WPA support |
| NetworkManager | Connection profiles and IP setup | Controls it over D-Bus |
| systemd-networkd | Addresses and routes on servers | Runs after it completes the link |
| iwd | Alternative wireless daemon | Replaces it with a smaller design |
| hostapd | Access point and authenticator role | Sister project for the other side |
The iwd daemon is a newer alternative that NetworkManager can use as its backend. It has fewer dependencies and fast reconnection, but wpa_supplicant remains the most widely supported implementation, especially for unusual EAP methods, Wi-Fi Direct and wired 802.1X.
Common problems and safe practice
Most failures come from conflicting managers, missing regulatory settings or incomplete enterprise configuration rather than from the daemon itself.
- Two managers on one interface: running a manual instance while NetworkManager also controls the card causes constant disconnections.
- No IP address after connection: the link is ready, but no DHCP client or network manager has been started.
- Missing country code: some channels stay disabled, so 5 GHz networks may be invisible.
- No CA certificate in enterprise profiles: credentials can be harvested by an impersonating access point.
- World-readable configuration file: passwords and PSKs should be readable only by root.
- Debugging blind: running in the foreground with
-dshows each stage and the exact reason for failure.
The idea in brief
wpa_supplicant is the part of a Linux system that knows the Wi-Fi password and proves it to the router. Think of it as the person at the door who shows the right badge so the building lets you in.
Once the door is open, its job is done. Another program gives the computer its address on the network. If Wi-Fi shows as connected but nothing loads, the problem is often in that second step, not in wpa_supplicant.
A practical scenario
A systems engineer deploys fifty headless sensor gateways on a university campus that uses WPA2-Enterprise with EAP-TLS. The devices run a minimal Linux image without NetworkManager, so each one starts wpa_supplicant through a systemd unit for wlan0, with systemd-networkd handling DHCP afterwards.
Each gateway receives its own client certificate, a private key readable only by root and the campus CA certificate in the network block. During a pilot, two devices fail to connect; running wpa_supplicant with -d reveals a certificate validity error caused by a clock that had not been synchronized. After enabling time synchronization before network startup, all fifty gateways connect reliably, and revoking a single certificate is enough to remove a lost device from the network.