wpa_cli
Interactive frontend for wpa_supplicant
TLDR
Scan for available networks
$ sudo wpa_cli scan
Show scan results$ sudo wpa_cli scan_results
Add a new network$ sudo wpa_cli add_network
Set network SSID$ sudo wpa_cli set_network 0 ssid '"[MyNetwork]"'
Set network password$ sudo wpa_cli set_network 0 psk '"[password]"'
Enable a network$ sudo wpa_cli enable_network 0
Save configuration$ sudo wpa_cli save_config
Show connection status$ sudo wpa_cli status
SYNOPSIS
wpa_cli [-p path] [-g socket] [-i ifname] [-hvB] [-a file] [command]
DESCRIPTION
wpa_cli is a text-based frontend for interacting with wpa_supplicant. It can query network status, modify configuration, and handle authentication requests. It operates in interactive mode with a prompt or command-line mode with arguments.
PARAMETERS
-p PATH
Specify path to control sockets-g PATH
Connect to the global control socket at the indicated path-i IFNAME
Select network interface-a FILE
Run in daemon mode with action file for events-B
Run as background daemon-P FILE
Set the location of the PID file-G INTERVAL
Set ping interval in secondsstatus
Show current connection statusscan
Initiate a network scanscan_results
Display scan resultslist_networks
List configured networksadd_network
Add a new network (returns network ID)set_network ID PARAM VALUE
Set network parameterenable_network ID
Enable a networkdisable_network ID
Disable a networkselect_network ID
Select and enable a network, disabling otherssave_config
Save current configuration to filereconfigure
Reload configuration filedisconnect
Disconnect from current networkreassociate
Force reconnectionterminate
Stop wpa_supplicant
CAVEATS
Requires root privileges or proper group membership for the control interface. The control interface can be configured to allow non-root access through the ctrlinterface GROUP parameter in wpasupplicant.conf.
HISTORY
wpa_cli is part of wpa_supplicant, a WPA and WPA2 supplicant for Linux, BSD, and Windows, commonly used for wireless network authentication.
SEE ALSO
wpa_supplicant(8), iwconfig(8), nmcli(1), iw(8)
