wpa_cli 操作指令使用指南

本文档详细介绍了如何启动wpa_supplicant和wpa_cli,并提供了wpa_cli的完整命令集,包括连接无线网络、配置网络变量、扫描网络、选择网络等操作。通过实例演示了如何使用wpa_cli连接到指定的WiFi网络并保存配置。
摘要由CSDN通过智能技术生成

一. Wpa_supplicant 启动脚本:

      wpa_supplicant -Dnl80211 -iwlan0 -c/data/misc/wifi/wpa_supplicant.conf  -O/data/misc/wifi/sockets

二. Wpa_cli 启动:

      wpa_cli是命令行界面下的无线网连接工具,在wpa_supplicant运行的基础上,打开wpa_cli:

      wpa_cli -iwlan0 -p/data/misc/wifi/sockets

三. wpa_cli 整套指令如下:

root@:/system/bin # wpa_cli -iwlan0 -p/data/misc/wifi/sockets        

wpa_cli v2.5-devel-6.0

Copyright (c) 2004-2015, Jouni Malinen <j@w1.fi> and contributors

This software may be distributed under the terms of the BSD license.

See README for more details.

Interactive mode

> help

commands:

  status [verbose] = get current WPA/EAPOL/EAP status

  ifname = get current interface name

  ping = pings wpa_supplicant

  relog = re-open log-file (allow rolling logs)

  note <text> = add a note to wpa_supplicant debug log

  mib = get MIB variables (dot1x, dot11)

  help [command] = show usage help

  interface [ifname] = show interfaces/select interface

  level <debug level> = change debug level

  license = show full wpa_cli license

  quit = exit wpa_cli

  set = set variables (shows list of variables when run without arguments)

  dump = dump config variables

  get <name> = get information

  logon = IEEE 802.1X EAPOL state machine logon

  logoff = IEEE 802.1X EAPOL state machine logoff

  pmksa = show PMKSA cache

  pmksa_flush = flush PMKSA cache entries

  reassociate = force reassociation

  reattach = force reassociation back to the same BSS

  preauthenticate <BSSID> = force preauthentication

  identity <network id> <identity> = configure identity for an SSID

  password <network id> <password> = configure password for an SSID

  new_password <network id> <password> = change password for an SSID

  pin <network id> <pin> = configure pin for an SSID

  otp <network id> <password> = configure one-time-password for an SSID

  passphrase <network id> <passphrase> = configure private key passphrase

    for an SSID

  sim <network id> <pin> = report SIM operation result

  bssid <network id> <BSSID> = set preferred BSSID for an SSID

  blacklist <BSSID> = add a BSSID to the blacklist

  blacklist clear = clear the blacklist

  blacklist = display the blacklist

  log_level <level> [<timestamp>] = update the log level/timestamp

  log_level = display the current log level and log options

  list_networks = list configured networks

  select_network <network id> = select a network (disable others)

  enable_network <network id> = enable a network

  disable_network <network id> = disable a network

  add_network = add a network

  remove_network <network id> = remove a network

  set_network <network id> <variable> <value> = set network variables (shows

    list of variables when run without arguments)

  get_network <network id> <variable> = get network variables

  dup_network <src network id> <dst network id> <variable> = duplicate network variables

  list_creds = list configured credentials

  add_cred = add a credential

  remove_cred <cred id> = remove a credential

  set_cred <cred id> <variable> <value> = set credential variables

  get_cred <cred id> <variable> = get credential variables

  save_config = save the current configuration

  disconnect = disconnect and wait for reassociate/reconnect command before

    connecting

  reconnect = like reassociate, but only takes effect if already disconnected

  scan = request new BSS scan

  scan_results = get latest scan results

  bss <<idx> | <bssid>> = get detailed scan result info

  get_capability <eap/pairwise/group/key_mgmt/proto/auth_alg/channels/freq/modes> = get capabilities

  reconfigure = force wpa_supplicant to re-read its configuration file

  terminate = terminate wpa_supplicant

  interface_add <ifname> <confname> <driver> <ctrl_interface> <driver_param>

    <bridge_name> = adds new interface, all parameters but <ifname>

    are optional

  interface_remove <ifname> = removes the interface

  interface_list = list available interfaces

  ap_scan <value> = set ap_scan parameter

  scan_interval <value> = set scan_interval parameter (in seconds)

  bss_expire_age <value> = set BSS expiration age parameter

  bss_expire_count <value> = set BSS expiration scan count parameter

  bss_flush <value> = set BSS flush age (0 by default)

  stkstart <addr> = request STK negotiation with <addr>

  ft_ds <addr> = request over-the-DS FT with <addr>

  wps_pbc [BSSID] = start Wi-Fi Protected Setup: Push Button Configuration

  wps_pin <BSSID> [PIN] = start WPS PIN method (returns PIN, if not hardcoded)

  wps_ch

  • 11
    点赞
  • 58
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值