Manual Network Connection with wpa_supplicant
After recovering a WPA/WPA2 passphrase or enterprise credentials, connecting to the network directly gives you a routable IP address and full access to the internal segment. nmcli is the simplest method when NetworkManager is running, but wpa_supplicant and dhclient give direct control without depending on NetworkManager — useful when NetworkManager has been killed for monitor mode or when connecting to enterprise networks that require specific EAP configuration.
Connect to a WPA/WPA2 Personal Network with nmcli
The fastest method when NetworkManager is running:
Device 'wlan0' successfully activated with 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'.
If NetworkManager was killed for monitor mode, restart it first:
Connect with wpa_supplicant Manually
When you need direct control without NetworkManager, generate a wpa_supplicant configuration from the SSID and passphrase:
Start wpa_supplicant against the interface in managed mode:
Successfully initialized wpa_supplicant
-D nl80211 specifies the driver. -B runs wpa_supplicant in the background. After a few seconds, check the connection status:
wpa_state=COMPLETED ssid=TargetNetwork bssid=aa:bb:cc:dd:ee:ff ip_address=192.168.1.105
wpa_state=COMPLETED confirms the 4-way handshake completed and the session is active. If an IP is not shown, request one with dhclient.
Request an IP Address with dhclient
After wpa_supplicant connects, request a DHCP lease:
Verify the assigned address and gateway:
Connect to a WPA Enterprise Network with wpa_supplicant
Enterprise connections require a more detailed wpa_supplicant configuration. Create the config manually for PEAP/MSCHAPv2:
If the enterprise network uses a self-signed or internal CA certificate, set ca_cert to the path of the CA file or remove the line entirely and add phase1="peaplabel=0" and ca_cert="" to skip certificate validation — only appropriate when the network is already known to not validate certificates.
Disconnect and Clean Up
References
-
Arch Linux Wiki — wpa_supplicantwiki.archlinux.org/title/wpa_supplicant (opens in new tab)
Full wpa_supplicant configuration reference including enterprise EAP settings
-
dhclient man pagelinux.die.net/man/8/dhclient (opens in new tab)
DHCP lease request and release flags
Was this helpful?
Your feedback helps improve this page.