wpa_supplicant

On this page 7

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.

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.

StageWhat happensTypical failure sign
ScanCollects nearby networks and their security capabilitiesNetwork not found
SelectionMatches results against configured network blocksWrong SSID or priority
AssociationJoins the chosen access pointAssociation rejected
AuthenticationRuns SAE or EAP to establish the PMKWrong password or certificate error
Four-way handshakeDerives and installs session keysHandshake timeout
CompletedEncrypted link ready for IP configurationNo address until DHCP runs
Connection stages handled by wpa_supplicant

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.

ValueSecurity modeCredentialNotes
WPA-PSKWPA2-PersonalPassphrase or 256-bit PSKVulnerable to offline guessing if weak
SAEWPA3-PersonalPasswordResists offline dictionary attacks
WPA-EAPWPA2 or WPA3-EnterpriseCertificate or usernameRequires a RADIUS server
OWEEnhanced OpenNoneEncrypts open networks without authentication
NONEOpen or legacy WEPNone or static keyAvoid on any sensitive network
Common key_mgmt values

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 flagMeaningExample
-iNetwork interface to manage-i wlan0
-cPath to the configuration file-c /etc/wpa_supplicant/wpa_supplicant.conf
-DDriver backend-D nl80211 or -D wired
-BRun in the background as a daemon-B
ctrl_interfaceLocation of the control socket/run/wpa_supplicant
countryRegulatory domain for allowed channelscountry=US
priorityPreference among several known networkspriority=10
Key options and command-line flags

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.

ToolMain responsibilityRelationship to wpa_supplicant
iwRadio and interface settings through nl80211Complements it; no WPA support
NetworkManagerConnection profiles and IP setupControls it over D-Bus
systemd-networkdAddresses and routes on serversRuns after it completes the link
iwdAlternative wireless daemonReplaces it with a smaller design
hostapdAccess point and authenticator roleSister project for the other side
Division of responsibilities

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 -d shows 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.