wpa_supplicant 的使用

简介: wpa_supplicant 的使用


  • 概述

wpa_supplicant是wifi客户端(client)加密认证工具,

和iwconfig不同,wpa_supplicant支持wep、wpa、wpa2等完整的加密认证,而iwconfig只能支持wep。

和wpa_supplocant相对应的,ap端的加密认证工具为hostapd。

wpa_supplicant运行于后台,它需要借助控制台工具wpa_cli来进行手动操作

  • 配置文件

在wpa_supplicant源码目录下,存在参考的配置文件wpa_supplicant.conf,几乎包含里所有的配置项。

我们的配置文件不需要这么复杂,开始测试阶段,我只写最简单的配置文件,其它手动操作先。

在/etc/下建立配置文件wpa_supplicant.conf,内容如下:

ctrl_interface=/var/run/wpa_supplicant
update_config=1
 
#其中,update_config=1使能配置更改。
  • wpa_supplicant参数
#wpa_supplicant --help
usage:
  wpa_supplicant [-BddhKLqqtuvW] [-P<pid file>] [-g<global ctrl>] \
        [-G<group>] \
        -i<ifname> -c<config file> [-C<ctrl>] [-D<driver>] [-p<driver_param>] \
        [-b<br_ifname>] [-e<entropy file>] \
        [-o<override driver>] [-O<override ctrl>] \
        [-N -i<ifname> -c<conf> [-C<ctrl>] [-D<driver>] \
        [-p<driver_param>] [-b<br_ifname>] [-I<config file>] ...]
 
drivers:
  nl80211 = Linux nl80211/cfg80211
  wext = Linux wireless extensions (generic)
  hostap = Host AP driver (Intersil Prism2/2.5/3)
  wired = Wired Ethernet driver
options:
  -b = optional bridge interface name
  -B = run daemon in the background
  -c = Configuration file
  -C = ctrl_interface parameter (only used if -c is not)
  -i = interface name
  -I = additional configuration file
  -d = increase debugging verbosity (-dd even more)
  -D = driver name (can be multiple drivers: nl80211,wext)
  -e = entropy file
  -g = global ctrl_interface
  -G = global ctrl_interface group
  -K = include keys (passwords, etc.) in debug output
  -t = include timestamp in debug messages
  -h = show this help text
  -L = show license (BSD)
  -o = override driver parameter for new interfaces
  -O = override ctrl_interface parameter for new interfaces
  -p = driver parameters
  -P = PID file
  -q = decrease debugging verbosity (-qq even less)
  -u = enable DBus control interface
  -v = show version
  -W = wait for a control interface monitor before starting
  -N = start describing new interface
  
example:
 
wpa_supplicant -Dnl80211 -iwlan0 -c /etc/wpa_supplicant.conf -dd >/var/wifi_log &”

其中最常用的为:-i 指定端口,-c 指定配置文件,-D 指定使用的wifi驱动

我们这里只指定端口和配置文件,驱动使用默认的。

wpa_supplicant启动操作命令

wpa_supplicant -i ath0 -c /etc/wpa_supplicant.conf &


目录
相关文章
|
1月前
|
数据安全/隐私保护 Android开发 芯片
wpa_supplicant介绍
wpa_supplicant介绍
18 1
|
Python Windows Unix
|
vr&ar
wpa_supplicant移植
移植openssl-0.9.8za cp ../wpa_supplicant-2.5/patches/openssl-0.9.8za-tls-extensions.patch .patch -p1 < openssl-0.
1091 0
|
机器学习/深度学习 Unix Linux
wpa_supplicant drivers 查看跟踪
/**************************************************************************** * wpa_supplicant drivers 查看跟踪 * 说明: * 最近调试wifi的时候由于wpa_supplicant仅仅支持wext,但是芯片移植手册上 * 却要使用nl80211模式,总是找不到查询方法,于是今天跟wpa_supplicant代码的 * 时候发现通过-h参数就可以查看到。
1040 0
|
Windows Ubuntu
I.MX6 wpa_supplicant_8 编译问题
/************************************************************************ * I.MX6 wpa_supplicant_8 编译问题 * 说明: * 在移植wifi过程中,要编译wpa_supplicant_8这个模块,记录一下问题。
838 0
wpa_supplicant是什么?
/************************************************************************ * wpa_supplicant是什么? * 声明: * 最近要处理wifi这块的内容...
1321 0

热门文章

最新文章