wpa_cli调试工具的使用
wpa_cli调试工具的使用
1、查看无线网卡
root #ifconfig
……wlp3s0……wireless…
2、配置wpa_supplicant.conf
root #bzless /usr/share/doc/${P}/wpa_supplicant.conf.bz2 > /etc/wpa_supplicant/wpa_supplicant.conf
root # nano /etc/wpa_supplicant/wpa_supplicant.conf 内容大致如下:
# Allow users in the 'wheel' group to control wpa_supplicant ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=wheel # Make this file writable for wpa_gui / wpa_cli update_config=1
#network
network={
ssid="public library"
psk = "public library"
kea_mgmt=WPA-PS
}
3、配置NET
root # nano /etc/conf.d/net 修改或者增加以下内容
modules_wlp3s0="wpa_supplicant"
config_wlpe3s0="dhcp"
4、启动wpa_supplicant
# wpa_supplicant -B -Dnl80211 -iwlp3s0 -c/etc/wpa_supplicant/wpa_supplicant.conf
……successful.....
或者
# wpa_supplicant -Dnl80211 -iwlp3s0 -c/etc/wpa_supplicant/wpa_supplicant.conf &
[45623]
5、进入交互模式进行调试:
# wpa_cli -iwlp3s0
>scan
>scan_result
……ssid...
.......public library....
........public library.....
>select_net 0
>enable_net 0
>save_config
>quit
or
>add_net
1
>set_net 1 ssid "public library"
>set_net 1 key_mgmt WPA2-PSK
......因为有两个"public library"SSID,所以指定一下key_mgmt。
>set_net 1 psk "password"
>enable_net 1
>save_config
>quit
6、设置开机启动
root # nano /etc/conf.d/wpa_supplicant 内容如下:
wpa_supplicant_args=" -B -Dnl80211 -iwlp3s0 -c/etc/wpa_supplicant/wpa_supplicant.conf"
root #
rc-update add wpa_supplicant default
root #
/etc/init.d/wpa_supplicant start