linux 扫描wifi软件,ubuntu用shell命令wpa_cli工具连接wifi

1.查看wifi网卡

root@dpdk2-All-Series:~# ifconfig

b645b809717f96afef1da381854b1818.png

2.扫描wifi信号,并记下essid

root@dpdk2-All-Series:~# iwlist wlan1 scan

f86ad5ab0cb47e2b6b3e72fda12d7f66.png

3.进入交互模式

root@dpdk2-All-Series:~# wpa_cli

0d6398a41810f9b329205acb5132a79f.png

4.连接wifi

无密码模式(本例无密码)

>add_network

>set_network  0  ssid  "web.wlan.bjtu"

>set_network  0  key_mgmt  NONE

>enable_network  0

>quit

root@dpdk2-All-Series:~# dhclient wlan1

4024434a0aded1b2755b25d16d38b9d5.png

用浏览器打开就可以看到下面的画面!

35d25fd5fb7b979e45378de23248b6c9.png

有密码模式

>add_network

>set_network  0  ssid  "666"

>set_network  0  psk  "your pre-shared key"

>enable_network  0

>quit

root@dpdk2-All-Series:~# dhclient wlan1

5.命令手册

Full command

Short command

Description

status

stat

displays the current connection status

disconnect

disc

prevents wpa_supplicant from connecting to any access point

quit

q

exits wpa_cli

terminate

term

kills wpa_supplicant

reconfigure

recon

reloads wpa_supplicant with the configuration file supplied (-c parameter)

scan

scan

scans for available access points (only scans it, doesn‘t display anything)

scan_result

scan_r

displays the results of the last scan

list_networks

list_n

displays a list of configured networks and their status (active or not, enabled or disabled)

select_network

select_n

select a network among those defined to initiate a connection (ie select_network 0)

enable_network

enable_n

makes a configured network available for selection (ie enable_network 0)

disable_network

disable_n

makes a configured network unavailable for selection (ie disable_network 0)

remove_network

remove_n

removes a network and its configuration from the list (ie remove_network 0)

add_network

add_n

adds a new network to the list. Its id will be created automatically

set_network

set_n

shows a very short list of available options to configure a network when supplied with no parameters.

See next section for a list of extremely useful parameters to be used with set_network and get_network.

get_network

get_n

displays the required parameter for the specified network. See next section for a list of parameters

save_config

save_c

saves the configuration

  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值