wpa_cli和wpa_supplicant使用,配置无线AP名和密码,静态ip地址

配置静态ip方法分享:
通过串口命令行输入如下命令:     

1. 添加无线网络接入点(AP) 及其 密码:
# wpa_cli -p /data/misc/wpa_supplicant
wpa_cli v0.5.11
Copyright (c) 2004-2008, Jouni Malinen and contributors              
                                                                               
This program is free software. You can distribute it and/or modify it          
under the terms of the GNU General Public License version 2.                   
                                                                               
Alternatively, this software may be distributed under the terms of the         
BSD license. See README and COPYING for more details.                          
                                                                               
                                                                               
Selected interface 'eth0'                                                      
                                                                               
Interactive mode


> add_network
0
> set_network 0 ssid "camct_backup"
OK
> set_network 0 key_mgmt NONE
OK
>                           
>
> set_network 0 wep_key0 12345678901234567890123456
OK
> binder: release 1142:1142 transaction 2748 out, still active
select_network 0
OK
<2>CTRL-EVENT-STATE-CHANGE id=-1 state=2
>status                                                                          
bssid=00:00:00:00:00:00                                                        
ssid=camct_backup                                                              
id=0                                                                           
pairwise_cipher=WEP-104                                                        
group_cipher=WEP-104                                                           
key_mgmt=NONE                                                                  
wpa_state=COMPLETED           
      
2. 配置ip地址:

#wpa_supplicant -Dwext -ieth0 -c /data/misc/wifi/wpa_supplicant.conf -B
命令解释:
        参数-B代表后台运行,-ieth0代表使用设备eth0,-Dwex代表网卡芯片是wex,-c指定配置文件。

查看配置
#wpa_cli -p /data/misc/wpa_supplicant
>status                                                                   bssid=00:00:00:00:00:00                                                         ssid=camct_backup                                                               id=0                                                                            pairwise_cipher=WEP-104                                                         group_cipher=WEP-104                                                           
key_mgmt=NONE   
wpa_state=COMPLETED 
配置ip:
#ifconfig eth0 192.168.177.33
之后再查看配置会看到 ip_address=192.168.177.33 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值