LinuxCommandLibrary

wpa_cli

Interactive frontend for wpa_supplicant

TLDR

Scan for available networks

$ sudo wpa_cli scan
copy
Show scan results
$ sudo wpa_cli scan_results
copy
Add a new network
$ sudo wpa_cli add_network
copy
Set network SSID
$ sudo wpa_cli set_network 0 ssid "MyNetwork"
copy
Set network password
$ sudo wpa_cli set_network 0 psk "password"
copy
Enable a network
$ sudo wpa_cli enable_network 0
copy
Save configuration
$ sudo wpa_cli save_config
copy
Show connection status
$ sudo wpa_cli status
copy

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
-i IFNAME
Select network interface
-a FILE
Run in daemon mode with action file for events
-B
Run as background daemon
-G INTERVAL
Set ping interval in seconds
status
Show current connection status
scan
Initiate a network scan
scan_results
Display scan results
list_networks
List configured networks
add_network
Add a new network (returns network ID)
set_network ID PARAM VALUE
Set network parameter
enable_network ID
Enable a network
disable_network ID
Disable a network
select_network ID
Select and enable a network, disabling others
save_config
Save current configuration to file
reconfigure
Reload configuration file
reassociate
Force reconnection
terminate
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

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community