wifi

1.Linux环境下的无线相关操作命令

interface 指代当前网卡 一般是 wifi0 ,  eth0 ,  ath1等

ifconfig  - 常用查看网络设定及控制网卡(Windows下是ipconfig)   

 命令                     功能
ifconfig                   列出启动的网卡
ifconfig -a                 列出所有网卡,包含停用的网卡
ifconfig [interface] up          将[interdace]启动
ifconfig [interface] down         将[interdace]停用
ifconfig [interface] hw ether [MAC]   将[interdace]修改为[MAC] 

  

iwconfig  - 专用于控制及设定无线网卡iw

iwconfig [interface]                            查看无线网卡状态

当需要进行WEP相关操作时
iwconfig [interface] key off                    禁用WEP密钥    
iwconfig [interface] key s:password             设置WEP密钥为ASCII码     

设定网卡输出功率
iwconfig [interface] txpower 30mW               将输出功率调为30mW

当使用Prism芯片网卡的时候,可以用以下命令转变网卡模式
iwconfig [interface] mode master                转成无线接入点模式
iwconfig [interface] mode managed               转成无线客户端模式

  

iwpriv  - 设定无线网卡驱动程序提供参数.在使用Prism芯片的网卡时,常用到的命令如下:

iwpriv [interface] monitor [mode] [channel]

  其中:

  [mode]可设置的参数为:

    0 = 关闭监听模式

    1 = 在开启监听模式的状态框内加上Prism2相关的headers

    2 = 开启监听模式

  [channel]

    工作频道(1到14)

原文地址:https://www.cnblogs.com/suendanny/p/9529444.html