WPA_CLI Use of Debugging Tools

Source: Internet
Author: User
Tags crypt bssid

1:run Wpa_supplicant First

Use the following command:

Wpa_supplicant-dwext-iwlan0-c/data/system/wpa_supplicant-c/data/misc/wifi/wpa_supplicant.conf

(use "PS" to make sure Wpa_supplicant is running)

2:run the command line tool WPA_CLI to connect WiFi

Wpa_cli-p/data/system/wpa_supplicant-iwlan0

Then, it'll let you set network interactively

some common command:

>scan = To scan the neighboring AP

>scan_results = Show the scan results

>status = Check out of the current connection information

>terminate = Terminate Wpa_supplicant

>quit = Exit Wpa_cli

>add_network = It would return a network ID to you

>set_network <network id> <variable> <value> = Set Network variables (shows

List of variables when run without arguments), success'll return OK, or would return Fail

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

>disable_network <network id> = Disable a network

>enable_network <network id> = enable a network

3:example

For APs that doesn ' t has encryption

>add_network (It would display a network ID for you, assume it returns 0)

>set_network 0 SSID "666"

>set_network 0 Key_mgmt NONE

>enable_network 0

>quit

If normal, we have connectted to the AP "666" and now you need a IP to access Internet, for example:

DHCPCD Wlan0

If everything is OK, it'll get an IP & can access internet

For APS that have WEP

>add_network (assume returns 1)

>set_network 1 SSID "666"

>set_network 1 Key_mgmt NONE

>set_network 1 Wep_key0 "Your AP Passwork" (If usting ASCII, it need double quotation marks, if using hex, then don ' t NE Ed the double quotation marks)

>set_network 1 Wep_tx_keyidx 0

>select_network 1 (optional, remember, if you is connecting with another APS, you should select it to disable the Anot Her)

>enable_network 1

And then, get a IP to access internet

For APS that have WPA-PSK/WPA2-PSK

>add_network (assume returns 2)

>set_network 2 SSID "666"

>set_network 2 PSK "Your pre-shared Key"

>select_network 2 (optional, remember, if you is connecting with another APS, you should select it to disable the Anot Her)

>enable_network 2

There is still some others options to being set, but Wpa_supplicant would choose the default for you, the default would include All we need to set

And then, get a IP to access internet

For Hidden AP (supplemental)

In principle, as long as on the basis of the above set_network NetID Scan_ssid 1 can be tested without encryption hidden AP,WEP/WPA/WPA2 should be the same

Instance operations:

Status after a successful connection

[Email protected]:/usr/local/bin# iwconfig wlan0

Wlan0 IEEE 802.11bgn ESSID: "uslab_testing" nickname: "<[email protected]>"

mode:managed frequency:2.432 GHz Access point:84:c9:b2:88:0c:f2

Bit rate:300 MB/s sensitivity:0/0

Retry:off RTS Thr:off Fragment Thr:off

Encryption key:****-****-****-****-****-****-****-**** Security Mode:open

Power Management:off

Link quality=98/100 Signal level=98/100 Noise level=0/100

Rx Invalid nwid:0  Rx Invalid crypt:0 Rx Invalid frag:0

Tx Excessive retries:0   Invalid misc:0 Missed beacon:0

[Email protected]:/usr/local/bin# wpa_cli

WPA_CLI v0.7.3

Copyright (c) 2004-2010, Jouni Malinen <[email protected]> and contributors

This program is a free software. You can distribute it and/or modify it

Under the terms of the GNU general public License version 2.

Alternatively, this software is distributed under the terms of the

BSD License. See README and COPYING for more details.

Selected interface ' Wlan0 '

Interactive mode

> Scan_results

Bssid/frequency/signal Level/flags/ssid

84:C9:B2:88:0C:F2 2432 94 [wpa-psk-tkip+ccmp][wpa2-psk-tkip+ccmp][ess] Uslab_testing

> Status

Bssid=84:c9:b2:88:0c:f2

Ssid=uslab_testing

Id=0

Mode=station

pairwise_cipher=ccmp

Group_cipher=tkip

Key_mgmt=wpa2-psk

wpa_state=completed

Ip_address=192.168.0.101

>

Connection process

[Email protected]:/usr/local/bin# wpa_supplicant-b-iwlan0-dwext-c/usr/local/etc/wpa_supplicant.conf

+871x_drv-drv_open, Bup=0

===> firmwaredownload91c () FW:RTL819XFWIMAGEARRAY_TSMC

Fw_ver=v75, fw_subver=0, sig=0x88c0

FW Download ok!

Set RF Chip ID to rf_6052 and RF type to 2.

gpio_in=09

Erfpowerstatetoset=0

Iqk:start!!!

Path A iqk success!!

Path B iqk success!!

Path A iqk success!!

Path B iqk success!!

Iqk:final_candidate is 0

iqk:rege94=101 rege9c=2 regea4=fa regeac=3 regeb4=101 regebc=7 regec4=fd regecc=7

Path A IQ Calibration Success!

Path B IQ Calibration Success!

Pdmpriv->txpowertrackcontrol = 1

MAC Address from reg_macid = 84:c9:b2:7d:64:2d

MAC Address = 84:c9:b2:7d:64:2d

-871x_drv-drv_open, Bup=1

[Rtw_wx_set_pmkid] iw_pmksa_flush!

Set_mode = Iw_mode_infra

IOCTL[SIOCSIWAP]: Operation not permitted

[Rtw_wx_set_pmkid] iw_pmksa_flush!

[Email protected]:/usr/local/bin# wpa_cli

WPA_CLI v0.7.3

Copyright (c) 2004-2010, Jouni Malinen <[email protected]> and contributors

This program is a free software. You can distribute it and/or modify it

Under the terms of the GNU general public License version 2.

Alternatively, this software is distributed under the terms of the

BSD License. See README and COPYING for more details.

Selected interface ' Wlan0 '

Interactive mode

> Scan

Ok

> Survey done event (19)

<2>ctrl-event-bss-added 0 84:c9:b2:88:0c:f2

<2>ctrl-event-bss-added 1 02:e0:42:cb:c7:79

<2>ctrl-event-scan-results

> Scan_results

Bssid/frequency/signal Level/flags/ssid

84:C9:B2:88:0C:F2 2432 [wpa-psk-tkip+ccmp][wpa2-psk-tkip+ccmp][ess] uslab_testing

02:e0:42:cb:c7:79 2457 [WEP][IBSS] ____13__1

>

> Add_network

0

>

> Set_network 0 SSID "uslab_testing"

Ok

>

> Set_network 0 key_mgmt WPA-PSK

Ok

>

> Set_network 0 PSK "12345678"

Ok

>

> Enable_network 0

Ok

> Survey done event (19)

Wpa_set_auth_algs, Auth_alg_open_system

Set_mode = Iw_mode_infra

Wpa_ie (length:22):

0x30 0x14 0x01 0x00 0x00 0x0f 0xac 0x02

0x01 0x00 0x00 0x0f 0xac 0x04 0x01 0x00

0x00 0x0f 0xac 0x02 0x00 0x00 0x78 0xff

=>rtw_wx_set_essid

Ssid=uslab_testing, len=13

New Candidate:uslab_testing (84:C9:B2:88:0C:F2) rssi:-54

Rtw_select_and_join_from_scanned_queue:candidate:uslab_testing (84:C9:B2:88:0C:F2)

# # # Opt_ant_ (b), cur_ant (b)

Rtw_restructure_ht_ie IEEE80211_HT_CAP_MAX_AMSDU is set

<=rtw_wx_set_essid

Link to new AP

<2>ctrl-event-scan-results

<2>trying to associate with 84:c9:b2:88:0c:f2 (ssid= ' uslab_testing ' freq=2432 MHz)

> Link to Realtek 96B

Onauthclient

Onassocrsp

Report_join_res (1)

Hw_var_basic_rate:bratecfg (0x15d)

WMM (0): 0, a42b

WMM (1): 0, a44f

WMM (2): 0, 5e4322

WMM (3): 0, 2f3222

Htonassocrsp

~~~~stastakey:unicastkey

~~~~stastakey:groupkey

==> Rtw_set_key Algorithm (2), keyID (1), Key_mask (2)

Update RAID entry, MASK=0XFFFFFFF, arg=0xa0

Rtl8192c_set_fwjoinbssreport_cmd Mstatus (1)

Setfwrsvdpagepkt

Set RSVD page location to Fw.

=>mlmeext_joinbss_event_callback

<2>associated with 84:C9:B2:88:0C:F2

<2>wpa:key negotiation completed with 84:C9:B2:88:0C:F2 [ptk=ccmp Gtk=tkip]

<2>ctrl-event-connected-connection to 84:c9:b2:88:0c:f2 completed (auth) [Id=0 id_str=]

> Save

Ok

> Status

Bssid=84:c9:b2:88:0c:f2

Ssid=uslab_testing

Id=0

Mode=station

pairwise_cipher=ccmp

Group_cipher=tkip

Key_mgmt=wpa2-psk

wpa_state=completed

Ip_address=192.168.0.101

>

> Quit

[Email protected]:/usr/local/bin# udhcpc-i wlan0

UDHCPC (V0.9.9-pre) started

Sending Discover ...

Onaction_back

Onaction_back, action=0

Issue_action_ba, Category=3, Action=1, status=0

Sending Select for 192.168.0.101 ...

Lease of 192.168.0.101 obtained, Lease time 86400

Adding DNS 192.168.0.101

Adding DNS 192.168.0.102

[Email protected]:/usr/local/bin#

[Email protected]:/usr/local/bin# iwconfig wlan0

Wlan0 IEEE 802.11bgn ESSID: "uslab_testing" nickname: "<[email protected]>"

mode:managed frequency:2.432 GHz Access point:84:c9:b2:88:0c:f2

Bit rate:300 MB/s sensitivity:0/0

Retry:off RTS Thr:off Fragment Thr:off

Encryption key:****-****-****-****-****-****-****-**** Security Mode:open

Power Management:off

Link quality=100/100 Signal level=100/100 Noise level=0/100

Rx Invalid nwid:0  Rx Invalid crypt:0 Rx Invalid frag:0

Tx Excessive retries:0   Invalid misc:0 Missed beacon:0

[Email protected]:/usr/local/bin#./wpa_cli

WPA_CLI v0.7.3

Copyright (c) 2004-2010, Jouni Malinen <[email protected]> and contributors

This program is a free software. You can distribute it and/or modify it

Under the terms of the GNU general public License version 2.

Alternatively, this software is distributed under the terms of the

BSD License. See README and COPYING for more details.

Selected interface ' Wlan0 '

Interactive mode

> Disable_network 0

Ok

<2>ctrl-event-disconnected bssid=00:00:00:00:00:00 reason=0

> Rtl8192c_set_fwjoinbssreport_cmd mstatus (0)

<2>ctrl-event-bss-removed 0 84:c9:b2:88:0c:f2

> Status

wpa_state=disconnected

Ip_address=192.168.0.101

> Terminate

Ok

> (2) 871x_drv-drv_close, Bup=1, hw_init_completed=1

-871x_drv-drv_close, Bup=1

Rtl8192c_set_fwjoinbssreport_cmd mstatus (0)

' PING ' command failed.

Connection to wpa_supplicant lost-trying to reconnect

> Quit

[Email protected]:/usr/local/bin# PS

PID Uid vmsize Stat Command

1 root 528 S init [3]

2 root sw< [Kthreadd]

3 root sw< [ksoftirqd/0]

4 root sw< [events/0]

5 root sw< [Khelper]

sw< Root [kblockd/0]

sw< Root [KSUSPEND_USBD]

sw< Root [KHUBD]

sw< Root [Kseriod]

sw< Root [KMMCD]

104 root SW [Pdflush]

Root SW [Pdflush]

106 root sw< [kswapd0]

107 root sw< [aio/0]

215 root sw< [KAPMD]

262 root sw< [MTDBLOCKD]

332 root sw< [W1_control]

346 root sw< [rpciod/0]

424 Root 388 S </SBIN/UDEVD--daemon

445 root 584 S/sbin/syslogd-n-C 64-m 20

447 Root 564 S/sbin/klogd-n

470 Root 928 S-sh

478 root SW [Rtkthread]

485 Root 764 R PS

[Email protected]:/usr/local/bin#

WPA_CLI Use of Debugging Tools

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.