Linux command
wpa_cli 命令
安全
权限或系统影响较大,执行前请核对目标。
常用示例
Scan
sudo wpa_cli scan
Example
sudo wpa_cli scan_results
Add
sudo wpa_cli add_network
Example
sudo wpa_cli set_network 0 ssid '"[MyNetwork]"'
Example
sudo wpa_cli set_network 0 psk '"[password]"'
Enable
sudo wpa_cli enable_network 0
Save
sudo wpa_cli save_config
Example
sudo wpa_cli status
说明
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.
参数
- -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 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
- disconnect
- Disconnect from current network
- reassociate
- Force reconnection
- terminate
- Stop wpa_supplicant
FAQ
What is the wpa_cli command used for?
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.
How do I run a basic wpa_cli example?
Run `sudo wpa_cli scan` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -p PATH do in wpa_cli?
Specify path to control sockets