WPA_SUPPLICANT + WPA_CLI User Guide

Thisdocument had described the way to inform the wpa_supplicant to do theWiFi connection by using the wpa_cli. The wpa_supplicant hadsupported all kinds of security connections and WPS defined in the802.11 specification. So, we suggest use the wpa_supplicant to do theWiFi connection rather than the iwconfig wireless tool.


(A)WPA_SUPPLICANT + WPA_CLI User Guide


1.startwpa_supplicant in the background

wpa_supplicant-Dwext -iwlan0 -c /tmp/net/wpa.conf -B


2.ScaningAP and See Results

wpa_cli-p/var/run/wpa_supplicant scan

wpa_cli-p/var/run/wpa_supplicant scan_results


3.Connectto AP

a.OPEN

wpa_cli-p/var/run/wpa_supplicant remove_network 0

wpa_cli-p/var/run/wpa_supplicant ap_scan 1

wpa_cli-p/var/run/wpa_supplicant add_network

wpa_cli-p/var/run/wpa_supplicant set_network 0 ssid '"dlink"'

wpa_cli-p/var/run/wpa_supplicant set_network 0 key_mgmt NONE

wpa_cli-p/var/run/wpa_supplicant select_network0



b.WEP40

wpa_cli-p/var/run/wpa_supplicant remove_network 0

wpa_cli-p/var/run/wpa_supplicant ap_scan 1

wpa_cli-p/var/run/wpa_supplicant add_network

wpa_cli-p/var/run/wpa_supplicant set_network 0 ssid '"dlink"'

wpa_cli-p/var/run/wpa_supplicant set_network 0 key_mgmt NONE

wpa_cli-p/var/run/wpa_supplicant set_network 0 wep_key0 1234567890

wpa_cli-p/var/run/wpa_supplicant set_network 0 wep_tx_keyidx 0

wpa_cli-p/var/run/wpa_supplicant select_network0


c.WEP104

wpa_cli-p/var/run/wpa_supplicant remove_network 0

wpa_cli-p/var/run/wpa_supplicant ap_scan 1

wpa_cli-p/var/run/wpa_supplicant add_network

wpa_cli-p/var/run/wpa_supplicant set_network 0 ssid '"dlink"'

wpa_cli-p/var/run/wpa_supplicant set_network 0 key_mgmt NONE

wpa_cli-p/var/run/wpa_supplicant set_network 0 wep_key012345678901234567890123456

wpa_cli-p/var/run/wpa_supplicant set_network 0 wep_tx_keyidx 0

wpa_cli-p/var/run/wpa_supplicant select_network0


#Ifwep key is ASCII type,use the following cmd:

#WEP40: wpa_cli -p/var/run/wpa_supplicant set_network 0 wep_key0 '"12345"'

#WEP104:wpa_cli -p/var/run/wpa_supplicant set_network 0 wep_key0'"1234567890123"'


#WEPkey index is X from 0 to 3, change X for other key index and selectit.

#wpa_cli-p/var/run/wpa_supplicant set_network 0 wep_keyX12345678901234567890123456

#wpa_cli-p/var/run/wpa_supplicant set_network 0 wep_tx_keyidx X



d.TKIPand AES

wpa_cli-p/var/run/wpa_supplicant remove_network 0

wpa_cli-p/var/run/wpa_supplicant ap_scan 1

wpa_cli-p/var/run/wpa_supplicant add_network

wpa_cli-p/var/run/wpa_supplicant set_network 0 ssid '"dlink"'

wpa_cli-p/var/run/wpa_supplicant set_network 0 psk '"12345678"'

wpa_cli-p/var/run/wpa_supplicant select_network0



4.Ad-hocmode

a.OPEN

wpa_cli-p/var/run/wpa_supplicant scan

wpa_cli-p/var/run/wpa_supplicant scan_results

wpa_cli-p/var/run/wpa_supplicant remove_network 0

wpa_cli-p/var/run/wpa_supplicant ap_scan 2

wpa_cli-p/var/run/wpa_supplicant add_network

wpa_cli-p/var/run/wpa_supplicant set_network 0 ssid '"Adhoc_test"'

wpa_cli-p/var/run/wpa_supplicant set_network 0 mode 1

wpa_cli-p/var/run/wpa_supplicant set_network 0 key_mgmt NONE

wpa_cli-p/var/run/wpa_supplicant select_network0


b.WEP40

wpa_cli-p/var/run/wpa_supplicant scan

wpa_cli-p/var/run/wpa_supplicant scan_results

wpa_cli-p/var/run/wpa_supplicant remove_network 0

wpa_cli-p/var/run/wpa_supplicant ap_scan 2

wpa_cli-p/var/run/wpa_supplicant add_network

wpa_cli-p/var/run/wpa_supplicant set_network 0 ssid '"Adhoc_test"'

wpa_cli-p/var/run/wpa_supplicant set_network 0 mode 1

wpa_cli-p/var/run/wpa_supplicant set_network 0 key_mgmt NONE

wpa_cli-p/var/run/wpa_supplicant set_network 0 wep_key0 1234567890

wpa_cli-p/var/run/wpa_supplicant set_network 0 wep_tx_keyidx 0

wpa_cli-p/var/run/wpa_supplicant select_network0


c.WEP104

wpa_cli-p/var/run/wpa_supplicant scan

wpa_cli-p/var/run/wpa_supplicant scan_results

wpa_cli-p/var/run/wpa_supplicant remove_network 0

wpa_cli-p/var/run/wpa_supplicant ap_scan 2

wpa_cli-p/var/run/wpa_supplicant add_network

wpa_cli-p/var/run/wpa_supplicant set_network 0 ssid '"Adhoc_test"'

wpa_cli-p/var/run/wpa_supplicant set_network 0 mode 1

wpa_cli-p/var/run/wpa_supplicant set_network 0 key_mgmt NONE

wpa_cli-p/var/run/wpa_supplicant set_network 0 wep_key012345678901234567890123456

wpa_cli-p/var/run/wpa_supplicant set_network 0 wep_tx_keyidx 0

wpa_cli-p/var/run/wpa_supplicant select_network0



5.Savethe Current Connection AP configuration file

wpa_cli-p/var/run/wpa_supplicant save_config



6.WPSConnection

PushButton:

wpa_cli-p/var/run/wpa_supplicant remove_network 0

wpa_cli-p/var/run/wpa_supplicant wps_pbc any

PinCode:

wpa_cli-p/var/run/wpa_supplicant remove_network 0

wpa_cli-p/var/run/wpa_supplicant wps_pin any 12345670

or

wpa_cli-p/var/run/wpa_supplicant remove_network 0

wpa_cli-p/var/run/wpa_supplicant wps_pin any


7.GetCurrent Status of wpa_supplicant

wpa_cli-p/var/run/wpa_supplicant status



8.Disablecurrent network connection

wpa_cli-p/var/run/wpa_supplicant disable_network 0




(B)WPA_SUPPLICANT + WPA_CLI - Control interface commands


Followingcommands can be used with wpa_cli


PING

Thiscommand can be used to test whether wpa_supplicant is replying to thecontrol interface commands.

Theexpected reply is PONGif theconnection is open and wpa_supplicant is processing commands.


STATUS

Requestcurrent status information. The output is a text block with each linein

variable=valueformat. Forexample:

bssid=02:00:01:02:03:04

ssid=testnetwork

pairwise_cipher=CCMP

group_cipher=CCMP

key_mgmt=WPA-PSK

wpa_state=COMPLETED


LIST_NETWORKS

Listconfigured networks.

networkid / ssid / bssid / flags

0example network any [CURRENT]

(note:fields are separated with tabs)


SCAN

Requesta new BSS scan.


SCAN_RESULTS

Getthe latest scan results.

bssid/ frequency / signal level / flags / ssid

00:09:5b:95:e0:4e2412 208 [WPA-PSK-CCMP] jkm private

02:55:24:33:77:a32462 187 [WPA-PSK-TKIP] testing

00:09:5b:95:e0:4f2412 209 jkm guest

(note:fields are separated with tabs)


ADD_NETWORK

Adda new network. This command creates a new network with emptyconfiguration. The new network is

disabledand once it has been configured it can be enabled with ENABLE_NETWORKcommand.ADD_-

NETWORKreturns thenetworkid ofthe new network or FAIL on failure



SELECT_NETWORK<networkid>

Selecta network (disable others). Network id can be received from theLIST_NETWORKScommand

output.


ENABLE_NETWORK<networkid>

Enablea network. Network id can be received from the LIST_NETWORKScommandoutput.



DISABLE_NETWORK<networkid>

Disablea network. Network id can be received from the LIST_NETWORKScommandoutput. Special

networkid allcan be usedto disable all network.

.

REMOVE_NETWORK<networkid>

Removea network. Network id can be received from the LIST_NETWORKScommandoutput. Special

networkid allcan be usedto remove all network.



SET_NETWORK<networkid><variable><value>

Setnetwork variables. Network id can be received from the LIST_NETWORKScommandoutput.

Thiscommand uses the same variables and data formats as the configurationfile.


ssid(network name, SSID)

psk(WPA passphrase or pre-shared key)

key_mgmt(key management protocol, NONE, WPA-PSK, WPA-EAP)

proto( WPA WPA2)

pairwise( CCMP TKIP)

group( CCMP TKIP WEP40 WEP104)

wep_key0( set wep key for key index 0)

wep_tx_keyidx( select wep key index)






GET_NETWORK<networkid><variable>

Getnetwork variables. Network id can be received from the LIST_NETWORKScommandoutput.


SAVE_CONFIG

Savethe current configuration.



AP_SCAN<ap_scanvalue>

Changeap_scan value: 0 = no scanning, 1 = wpa_supplicant requests scans anduses scan results to select

theAP, 2 = wpa_supplicant does not use scanning and just requests driverto associate and take care of AP

selection


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Realtek_WPS_user_guide; RTK无线WPS操作手册 1. Introduction 1.1 Purpose This document describes supported WPS features of the series of Realtek 8xxx-SOC, the instructions of setting up a Wi-Fi network for different scenarios, and the recommended system configuration. 1.2 Scope This document is aimed to the engineers who have basic knowledge about WPS and will utilize Realtek 8xxx-SDK to develop their products. 1.3 Definitions of Wi-Fi Protected Setup terminologies (Wi-Fi Protected Setup Specification 1.0h.pdf, p. 11) WPS: Stands for Wi-Fi Protected Setup; an optional certification program designed to ease set up of security-enabled Wi-Fi networks in the home and small office environment. Device: An independent physical or logical entity capable of communicating with other Devices across a LAN or WLAN. Domain: A set of one or more Devices governed by a common authority for the purpose of gaining access to one or more WLANs. Enrollee: A Device seeking to join a WLAN Domain. Once an Enrollee obtains a valid credential, it becomes a Member. In-band: Data transfer using the WLAN communication channel. Out-of-band: Data transfer using a communication channel other than the WLAN Member: A WLAN Device possessing Domain credentials. Registration Protocol: A Registration Protocol is a (logically) three party in-band protocol to assign a Credential to the Enrollee. The protocol operates between the Enrollee and the Registrar and may receive support through a proxy. In this document, it is equivalent to “WPS handshake”. Registrar: An entity with the authority to issue and revoke Domain Credentials. A registrar may be integrated into an AP, or it may be separate from the AP. A registrar may not have WLAN capability. A given Domain may have multiple registrars. External Registrar: A registrar for an AP’s Domain that runs on a device separate
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值