精华内容
下载资源
问答
  • iwconfig

    千次阅读 2016-08-02 16:36:21
    iwconfig wlan0 txpower on 2. 列出区域内的无线网络 iwlist wlan0 scan 3. 假设要连接到网络MyHome(即essid为MyHome的网络),那么输入命令 iwconfig wlan0 essid “MyHome”  如果网络是加密的,密码是...
    1. 打开无线网卡电源
    

    iwconfig wlan0 txpower on
    2. 列出区域内的无线网络

    iwlist wlan0 scan
    3. 假设要连接到网络MyHome(即essid为MyHome的网络),那么输入命令

    iwconfig wlan0 essid “MyHome” 
    如果网络是加密的,密码是0123456789,那么就输入命令

    iwconfig wlan0 essid “MyHome” key 0123-4567-89
    4. 如果正常的话,输入

    iwconfig wlan0
    就可以看到连接正常的各项参数了。 
    5. 启用无线网卡

    ifconfig wlan0 up
    6. 如果是用DHCP获取IP的,那么用dhclient或dhcpcd获取ip

    dhclient wlan0


    dhcpcd wlan0

    7. 现在无线网卡应该可以正常使用了



    下载iwconfig工具相关的源代码,并成功交叉编译通过,用于实际项目中。
    可依据实际需要修改Makefile中的"CC=gcc","AR=ar"以及安装路径, 我是CC=$(TOOLCHAIN)/bin/arm-linux-gcc,和AR=$(TOOLCHAIN)/bin/arm-linux-ar;
    其余makefile不需要修改;用 make clean;make;make install即可编译安装。
    生成的libiw.so.29与其他工具一起。
    把生成的文件拷到目标板的/bin文件夹下,libiw.so.29拷到/lib下即可以使用相关命令。
    下面来自网络:
    iwconfig是Linux Wireless
    Extensions(LWE)的用户层配置工具之一。LWE是Linux下对无线网络配置的工具,包括内核的支持、用户层配置工具和驱动接口的支持三部
    分。现在很多无线网卡都支持LWE,而且主流的Linux发布版本,比如Redhat Linux、Ubuntu Linux都已带了这个配置工具。
    1、iwconfig
    用法: iwconfig interface [essid {NN|on|off}]
                              [nwid {NN|on|off}]
                              [mode {managed|ad-hoc|...}
                              [freq N.NNNN[k|M|G]]
                              [channel N]
                              [ap {N|off|auto}]
                              [sens N]
                              [nick N]
                              [rate {N|auto|fixed}]
                              [rts {N|auto|fixed|off}]
                              [frag {N|auto|fixed|off}]
                              [enc {NNNN-NNNN|off}]
                              [power {period N|timeout N}]
                              [retry {limit N|lifetime N}]
                              [txpower N {mW|dBm}]
                              [commit]
    说明:iwconfig是LWE最主要的工具,能够对无线网卡的大部分参数进行配置。
    参数:
    essid:配置无线网卡的ESSID(Extension Service Set ID)。通过ESSID来区分不同的无线网络,正常情况下只有相同ESSID的无线站点
             才能够互相通讯,除非想监听无线网络。其后的参数为双引号括起的ESSID字符串,或是any/on/off,假如ESSID字符串中包含
             any/no/off,则需要在前面加"--"。
             示例:
                 #iwconfig eth0 essid any                   允许任何ESSID,也就是混杂模式
                 #iwconfig eth0 essid "My Network"          配置ESSID为"My Network"
                 #iwconfig eth0 essid -- "ANY"              配置ESSID为"ANY"
                 
      nwid: Network ID,只用于pre-802.11的无线网卡,802.11网卡利用ESSID和AP的MAC地址来替换nwid,现在基本上不用配置。
             示例:
                 #iwconfig eth0 nwid AB34
                 #iwconfig eth0 nwid off
                 
      nick: Nickname,一些网卡需要配置该参数,但是802.11协议栈、MAC都没有用到该参数,一般也不用配置。
             示例:
                #iwconfig eth0 nickname "My Linux Node"
                
      mode:配置无线网卡的工作模式,能够是
            Ad-hoc:不带AP的点对点无线网络
            Managed:通过多个AP组成的网络,无线设备能够在这个网络中漫游
            Master:配置该无线网卡为一个AP
            Repeater:配置为无线网络中继设备,能够转发网络包
            Secondary:配置为备份的AP/Repeater
            Monitor:监听模式
            Auto:由无线网卡自动选择工作模式
            
              示例:
                #iwconfig eth0 mode Managed
                #iwconfig eth0 mode Ad-Hoc
                
      freq/channel:配置无线网卡的工作频率或频道,小于1000的参数被认为是频道,大于10000的参数被认为是频率。频率单位为Hz,
                    能够在数字后面附带k, M, G来改变数量级,比如2.4G。频道从1开始。使用lwlist工具能够查看无线网卡支持的频率
                    和频道。参数off/auto指示无线网络自动挑选频率。
             注意:假如是Managed模式,AP会指示无线网卡的工作频率,因此该配置的参数会被忽略。Ad-hoc模式下只使用该设定的频率
                初始无线网络,假如加入已存在的Ad-hoc网络则会忽略该配置的频率参数。
             示例:
              #iwconfig eth0 freq 2422000000
              #iwconfig eth0 freq 2.422G
              #iwconfig eth0 channel 3
              #iwconfig eth0 channel auto
      ap:连接到指定的AP或无线网络,后面的参数能够是AP的MAC地址,也能够是iwlist scan出来的标识符。假如是Ad-hoc,则连接到
          一个已存在的Ad-hoc网络。使用off参数让无线网卡不改变当前已连接的AP下进入自动模式。any/auto参数,无线网卡自动选择
          最好的AP。
            注意:假如无线信号低到一定程度,无线网络会进入自动选择AP模式。
            示例:
              #iwconfig eth0 ap 00:60:1D:01:23:45
              #iwconfig eth0 ap any
              #iwconfig eth0 ap off
      rate/bit:假如无线网卡支持多速率,则能够通过该命令配置工作的速率。小于1000的参数由具体的无线网卡驱动定义,一般是传输速
                率的索引值,大于1000的为速率,单位bps,能够在数字后面附带k, M, G来指定数量级。auto参数让无线网卡自动选择速率
                fixed参数让无线网卡不使用自动速率模式。
                
            示例:
             #iwconfig eth0 rate 11M
             #iwconfig eth0 rate auto
             #iwconfig eth0 rate 5.5M auto    //自动选择5.5M以下的速率
             
      txpower:假如无线网卡支持多发射功率设定,则使用该参数设定发射,单位为dBm,假如指定为W(毫瓦),只转换公式为:
               dBm=30+log(W)。参数on/off能够打开和关闭发射单元,auto和fixed指定无线是否自动选择发射功率。
            示例:
             #iwconfig eth0 txpower 15
             #iwconfig eth0 txpower 30mW
             #iwconfig eth0 txpower auto
             #iwconfig eth0 txpower off   
           
      sens:配置接收灵敏度的下限,在该下限之下,无线网卡认为该无线网络信号太差,不同的网卡会采取不同的措施,一些现代的无线网卡
            会自动选择新的AP。正的参数为raw data,直接传给无线网卡驱动处理,一般认为是百分比。负值表示dBm值。
            
            示例:
              #iwconfig eth0 sens -80
              #iwconfig eth0 sens 2
              
      retry:配置无线网卡的重传机制。limit ‘value’ 指定最大重传次数;lifetime ‘value’指定最长重试时间,单位为秒,能够附带m和u来
             指定单位为毫秒和微秒。假如无线网卡支持自动模式,则在limit和lifetime之前还能够附加min和max来指定上下限值。
             
           示例:
             #iwconfig eth0 retry 16
             #iwconfig eth0 retry lifetime 300m
             #iwconfig eth0 retry min limit 8
             
      rts:指定RTS/CTS握手方式,使用RTS/CTS握手会增加额外开销,但假如无线网络中有隐藏无线节点或有很多无线节点时能够提高性能。
           后面的参数指定一个使用该机制的最小包的大小,假如该值等于最大包大小,则相当于禁止使用该机制。能够使用auto/off/fixed
           参数。
           
           示例:
             #iwconfig eth0 rts 250
             #iwconfig eth0 rts off
             
      frag:配置发送数据包的分片大小。配置分片会增加额外开销,但在噪声环境下能够提高数据包的到达率。一般情况下该参数小于最大包
           大小,有些支持Burst模式的无线网卡能够配置大于最大包大小的值来允许Burst模式。还能够使用auto/fixed/off参数。
           
           示例:
             #iwconfig eth0 frag 512
             #iwconfig eth0 frag off      
             
      key/enc[ryption]:配置无线网卡使用的加密密钥,此处为配置WEP模式的加密key,假如要使用WPA,需要wpa_supplicant工具包。
            密钥参数能够是 XXXX-XXXX-XXXX-XXXX 或 XXXXXXXX 格式的十六进制数值,也能够是s:xxxxxx的ASCII字符。假如在密钥参数之前
            加了[index],则只是配置该索引值对应的密钥,并不改变当前的密钥。直接指定[index]值能够配置当前使用哪一个密钥。指定on/
            off能够控制是否使用加密模式。open/restricted指定加密模式,取决于不同的无线网卡,大多数无线网卡的open模式不使用加密且
            允许接收没有加密的数据包,restricted模式使用加密。能够使用多个key参数,但只有最后一个生效。
                WEP密钥能够是40bit,用10个十六进制数字或5个ASCII字符表示,也能够是128bit,用26个十六进制数字或13个ASCII字符表
            示。
            示例:
              #iwconfig eth0 key 0123-4567-89
              #iwconfig eth0 key [3] 0123-4567-89
              #iwconfig eth0 key s:password [2]
              #iwconfig eth0 key [2]
              #iwconfig eth0 key open
              #iwconfig eth0 key off
              #iwconfig eth0 key restricted [3] 0123456789
              #iwconfig eth0 key 01-23 key 45-67 [4] key [4]
              
      power:配置无线网卡的电源管理模式。period ‘value’ 指定唤醒的周期,timeout ‘value’指定进入休眠的等待时间,这两个参数之前能够
             加min和max修饰,这些值的单位为秒,能够附加m和u来指定毫秒和微秒。off/on参数指定是否允许电源管理,all/unicast/multicast
             指定允许唤醒的数据包类型。
             
             示例:
             #iwconfig eth0 power period 2
             #iwconfig eth0 power 500m unicast
             #iwconfig eth0 power timeout 300u all
             #iwconfig eth0 power off
             #iwconfig eth0 power min period 2 power max period 4
             
      commit:提交任何的参数修改给无线网卡驱动。有些无线网卡驱动会先缓存无线网卡参数修,使用这个命令来让无线网卡的参数修改生效。但是一
              般无需使用该命令,因为无线网卡驱动最终都会是参数的修改生效,一般在debug时会用到。
    为了方便配置,能够把配置写到 /etc/network/interfaces中,这样以后就不用反复配置了。
    • auto loiface lo inet loopback

    • auto eth1
    • iface eth1 inet staticaddress 192.168.1.3
    • netmask 255.255.255.0gateway 192.168.1.1
    • echo nameserver 192.168.1.1>/etc/resolv.confpre-up /sbin/iwconfig eth1 essid "LW HOME LINK"
    • pre-up /sbin/iwconfig eth1 key s:liwei
    • auto usb0iface usb0 inet static
    • address 192.168.0.200netmask 255.255.255.0
    • auto dsl-provideriface dsl-provider inet ppp
    • pre-up /sbin/ifconfig eth0 up # line maintained by pppoeconfprovider dsl-provider

    • auto eth0
    • iface eth0 inet manual

    展开全文
  • iwlist iwconfig 

    2017-10-23 19:10:29
    可以直接在海思 3559 3519 等平台上直接调试WIFI功能使用的 iwlist iwconfig 工具
  • android 工具 iwconfig

    2020-10-29 17:10:45
    iwconfig 工具安卓使用 , 需要root权限, 你可以把他adb到 data目录或者system/xbin下
  • iwconfig使用

    千次阅读 2017-05-22 14:59:36
    iwconfig用法 1.打开无线网卡电源 iwconfig wlan0 txpower no 2.列出区域内的无线网络 iwconfig wlan0 scan 3.假设要连接到网络myhome(即essid为myhome的网络),那么输入命令 iwconfig wlan0 essid ...

    iwconfig用法

    1.打开无线网卡电源

    iwconfig wlan0 txpower no


    2.列出区域内的无线网络

    iwconfig wlan0 scan


    3.假设要连接到网络myhome(即essid为myhome的网络),那么输入命令

    iwconfig wlan0 essid "myhome"


    如果网络是加密的,密码是0123456789,那么就输入命令

    iwconfig wlan0 essid "myhome" key 0123-4567-89


    4 如果正常的话,输入

    iwconfig wlan0

    就可以看到连接正常的各项参数了。


    5.启动无线网卡

    ifconfig wlan0 up


    6.如果是用DHCP获取IP的,那么用dhclient或dhcpcd获取ip

    dhclient wlan0 dhcpcd wlan0


    7.现在无线网卡应该可以正常使用了。


    WPA Supplicant

    WPA Supplicant工具包可以让您连接到那些使用WPA的AP。因为还只是beta版,所以它的配置方法仍会常常变化——尽管如此,在大部分情况下它已经能很好的工作。

    代码 2.1: 安装wpa_supplicant

    # emerge net-wireless/wpa_supplicant
    

    重要: 要让wpa_supplicant正常工作,您必须在内核中打开CONFIG_PACKET支持。

    现在我们需要配置一下/etc/conf.d/net文件以便我们可以选择使用wpa_supplicant而不用wireless-tools(两者都安装在系统中时,默认使用的是wireless-tools)。

    代码 2.2: 在/etc/conf.d/net中配置wpa_supplicant

    # 使用wpa_supplicant代替wireless-tools
    modules=( "wpa_supplicant" )
    
    # 因为wpa_supplicant还不能很好的自动侦测驱动,所以需要我们为其指定正在使用的驱动。
    wpa_supplicant_eth0="-Dmadwifi"
    

    注意: 如果您用host-ap驱动,您首先要将无线设备卡设置成Managed模式以便能正确地配合wpa_supplicant工作。你可以在/etc/conf.d/net中设置iwconfig_eth0="mode managed"来实现这一点。

    看起来这很简单,不是么?不过我们还需要配置wpa_supplicant本身,这将会比较麻烦一些,具体取决于你要连接的AP的安全程度。下面的例子是从/usr/share/doc/wpa_supplicant-<version>/wpa_supplicant.conf.gz中抽取并简化而来的,此文件出自wpa_supplicant软件包。

    代码 2.3: 一个/etc/wpa_supplicant/wpa_supplicant.conf的例子

         
    1. # 请不要修改下面这一行内容,否则将不能正常工作  
    2. ctrl_interface=/var/run/wpa_supplicant  
    3.   
    4. # 确保只有root用户能读取WPA的配置  
    5. ctrl_interface_group=0  
    6.   
    7. # 使用wpa_supplicant来扫描和选择AP  
    8. ap_scan=1  
    9.   
    10. # 简单的情形:WPA-PSk密码验证方式,PSK是ASCII密码短语,所有合法的加密方式都允许连接  
    11. network={  
    12.   ssid="simple"  
    13.   psk="very secret passphrase"  
    14.   # 优先级越高,就能越早匹配到。  
    15.   priority=5  
    16. }  
    17.   
    18. # 与前面的设置相同,但要求对特定的SSID进行扫描(针对那些拒绝广播SSID的AP)  
    19. network={  
    20.   ssid="second ssid"  
    21.   scan_ssid=1  
    22.   psk="very secret passphrase"  
    23.   priority=2  
    24. }  
    25.   
    26. # 仅使用WPA-PSK方式。允许使用任何合法的加密方式的组合  
    27. network={  
    28.   ssid="example"  
    29.   proto=WPA  
    30.   key_mgmt=WPA-PSK  
    31.   pairwise=CCMP TKIP  
    32.   group=CCMP TKIP WEP104 WEP40  
    33.   psk=06b4be19da289f475aa46a33cb793029d4ab3db7a23ee92382eb0106c72ac7bb  
    34.   priority=2  
    35. }  
    36.   
    37. # 明文连接方式(不使用WPA和IEEE802.1X)  
    38. network={  
    39.   ssid="plaintext-test"  
    40.   key_mgmt=NONE  
    41. }  
    42.   
    43. # 共享WEP密钥连接方式(不使用WPA和IEEE802.1X)  
    44. network={  
    45.   ssid="static-wep-test"  
    46.   key_mgmt=NONE  
    47.   # 引号包含的密钥是ASCII密钥  
    48.   wep_key0="abcde"  
    49.   # 没有引号包含的密钥是十六进制密钥  
    50.   wep_key1=0102030405  
    51.   wep_key2="1234567890123"  
    52.   wep_tx_keyidx=0  
    53.   priority=5  
    54. }  
    55.   
    56. # 共享WEP密钥连接方式(无WPA和IEEE802.1X),使用共享密钥IEEE802.11验证方式  
    57. network={  
    58.   ssid="static-wep-test2"  
    59.   key_mgmt=NONE  
    60.   wep_key0="abcde"  
    61.   wep_key1=0102030405  
    62.   wep_key2="1234567890123"  
    63.   wep_tx_keyidx=0  
    64.   priority=5  
    65.   auth_alg=SHARED  
    66. }  
    67.   
    68. # 在IBSS/ad-hoc网络中使用WPA-None/TKIP  
    69. network={  
    70.   ssid="test adhoc"  
    71.   mode=1  
    72.   proto=WPA  
    73.   key_mgmt=WPA-NONE  
    74.   pairwise=NONE  
    75.   group=TKIP  
    76.   psk="secret passphrase"  
    77. }  
    展开全文
  • iwconfig命令

    万次阅读 2019-04-18 09:54:28
    iwconfig命令 iwconfig命令用于系统配置无线网络设备或显示无线网络设备信息。iwconfig命令类似于ifconfig命令,但是他配置对象是无线网卡,它对网络设备进行无线操作,如设置无线通信频段。 auto 自动模式 essid ...

    iwconfig命令

    iwconfig命令用于系统配置无线网络设备或显示无线网络设备信息。iwconfig命令类似于ifconfig命令,但是他配置对象是无线网卡,它对网络设备进行无线操作,如设置无线通信频段。

    auto 自动模式
    essid 设置ESSID
    nwid 设置网络ID
    freq 设置无线网络通信频段
    chanel 设置无线网络通信频段
    sens 设置无线网络设备的感知阀值
    mode 设置无线网络设备的通信设备
    ap 强迫无线网卡向给定地址的接入点注册
    nick<名字> 为网卡设定别名
    rate<速率> 设定无线网卡的速率
    rts<阀值> 在传输数据包之前增加一次握手,确信信道在正常的
    power 无线网卡的功率设置

    实例

    essid:设置无线网卡的ESSID(Extension Service Set ID)。通过ESSID来区分不同的无线网络,正常情况下只有相同ESSID的无线站点才可以互相通讯,除非想监听无线网络。其后的参 数为双引号括起的ESSID字符串,或者是any/on/off,如果ESSID字符串中包含any/no/off,则需要在前面加"--"。

    [root@localhost ~]# iwconfig wlan0 essid any # 允许任何ESSID,也就是混杂模式
    [root@localhost ~]# iwconfig wlan0 essid "My Network" # 设置ESSID为"My Network"
    [root@localhost ~]# iwconfig wlan0 essid -- "ANY"     # 设置ESSID为"ANY"

    nwid: Network ID,只用于pre-802.11的无线网卡,802.11网卡利用ESSID和AP的MAC地址来替换nwid,现在基本上不用设置。

    [root@localhost ~]# iwconfig wlan0 nwid AB34
    [root@localhost ~]# iwconfig wlan0 nwid off

    nick: Nickname,一些网卡需要设置该参数,但是802.11协议栈、MAC都没有用到该参数,一般也不用设置。

    [root@localhost ~]# iwconfig wlan0 nickname "My Linux Node"

    mode:设置无线网卡的工作模式,可以是Ad-hoc:不带AP的点对点无线网络Managed:通过多个AP组成的网络,无线设备可以在这个网络中漫游Master:设置该无线网卡为一个 APRepeater:设置为无线网络中继设备,可以转发网络包Secondary:设置为备份的 AP/RepeaterMonitor:监听模式Auto:由无线网卡自动选择工作模式

    [root@localhost ~]# iwconfig wlan0 mode Managed
    [root@localhost ~]# iwconfig wlan0 mode Ad-Hoc

    freq/channel:设置无线网卡的工作频率或者频道,小于1000的参数被认为是频道,大于 10000的参数被认为是频率。频率单位为Hz,可以在数字后面附带k, M, G来改变数量级,比 如2.4G。频道从1开始。使用lwlist工具可以查看无线网卡支持的频率和频道。参数off/auto 指示无线网络自动挑选频率。注意:如果是Managed模式,AP会指示无线网卡的工作频率 ,因此该设置的参数会被忽略。Ad-hoc模式下只使用该设定的频率初始无线网络,如果加入 已经存在的Ad-hoc网络则会忽略该设置的频率参数。

    [root@localhost ~]# iwconfig wlan0 freq 2422000000
    [root@localhost ~]# iwconfig wlan0 freq 2.422G
    [root@localhost ~]# iwconfig wlan0 channel 3
    [root@localhost ~]# iwconfig wlan0 channel auto

    ap:连接到指定的AP或者无线网络,后面的参数可以是AP的MAC地址,也可以是iwlist scan 出来的标识符。如果是Ad-hoc,则连接到一个已经存在的Ad-hoc网络。使用off参数让无线网卡不改变当前已连接的AP下进入自动模式。any/auto参数,无线网卡自动选择最好的AP。注意:如果无线信号低到一定程度,无线网络会进入自动选择AP模式。

    [root@localhost ~]# iwconfig wlan0 ap 00:60:1D:01:23:45
    [root@localhost ~]# iwconfig wlan0 ap any
    [root@localhost ~]# iwconfig wlan0 ap off

    rate/bit:如果无线网卡支持多速率,则可以通过该命令设置工作的速率。小于1000的参数 由具体的无线网卡驱动定义,一般是传输速率的索引值,大于1000的为速率,单位bps,可以 在数字后面附带k, M, G来指定数量级。auto参数让无线网卡自动选择速率fixed参数让无线 网卡不使用自动速率模式。

    [root@localhost ~]# iwconfig wlan0 rate 11M
    [root@localhost ~]# iwconfig wlan0 rate auto
    [root@localhost ~]# iwconfig wlan0 rate 5.5M auto    //自动选择5.5M以下的速率

    txpower:如果无线网卡支持多发射功率设定,则使用该参数设定发射,单位为dBm,如果指定为W(毫瓦),只转换公式为: dBm=30+log(W)。参数on/off可以打开和关闭发射单元,auto和fixed指定无线是否自动选择发射功率。

    [root@localhost ~]# iwconfig wlan0 txpower 15
    [root@localhost ~]# iwconfig wlan0 txpower 30mW
    [root@localhost ~]# iwconfig wlan0 txpower auto
    [root@localhost ~]# iwconfig wlan0 txpower off  

    sens:设置接收灵敏度的下限,在该下限之下,无线网卡认为该无线网络信号太差,不同的网卡会采取不同的措施,一些现代的无线网卡会自动选择新的AP。正的参数为raw data,直接传给无线网卡驱动处理,一般认为是百分比。负值表示dBm值。

    [root@localhost ~]# iwconfig wlan0 sens -80
    [root@localhost ~]# iwconfig wlan0 sens 2

    retry:设置无线网卡的重传机制。limit ‘value’指定最大重传次数;lifetime ‘value ’指定最长重试时间,单位为秒,可以附带m和u来指定单位为毫秒和微秒。如果无线网卡支持自动模式,则在limit和lifetime之前还可以附加min和max来指定上下限值。

    [root@localhost ~]# iwconfig wlan0 retry 16
    [root@localhost ~]# iwconfig wlan0 retry lifetime 300m
    [root@localhost ~]# iwconfig wlan0 retry min limit 8

    rts:指定RTS/CTS握手方式,使用RTS/CTS握手会增加额外开销,但如果无线网络中有隐藏无线节点或者有很多无线节点时可以提高性能。后面的参数指定一个使用该机制的最小包的大小,如果该值等于最大包大小,则相当于禁止使用该机制。可以使用auto/off/fixed参数。

    [root@localhost ~]# iwconfig wlan0 rts 250
    [root@localhost ~]# iwconfig wlan0 rts off

    frag:设置发送数据包的分片大小。设置分片会增加额外开销,但在噪声环境下可以提高数据包的到达率。一般情况下该参数小于最大包大小,有些支持Burst模式的无线网卡可以设置大于最大包大小的值来允许Burst模式。还可以使用auto/fixed/off参数。

    [root@localhost ~]# iwconfig wlan0 frag 512
    [root@localhost ~]# iwconfig wlan0 frag off     

    key/enc[ryption]:设置无线网卡使用的加密密钥,此处为设置WEP模式的加密key,如果要使用WPA,需要wpa_supplicant工具包。密钥参数可以是 XXXX-XXXX-XXXX-XXXX 或者  XXXXXXXX 格式的十六进制数值,也可以是s:xxxxxx的ASCII字符。如果在密钥参数之前加了 [index],则只是设置该索引值对应的密钥,并不改变当前的密钥。直接指定[index]值可以设置当前使用哪一个密钥。指定on/off可以控制是否使用加密模式。open/restricted指定加密模式,取决于不同的无线网卡,大多数无线网卡的open模式不使用加密且允许接收没有加密的数据包,restricted模式使用加密。可以使用多个key参数,但只有最后一个生效。WEP密钥可以是40bit,用10个十六进制数字或者5个ASCII字符表示,也可以是128bit,用26个十六进制数字或者13个ASCII字符表示。

    [root@localhost ~]# iwconfig wlan0 key 0123-4567-89
    [root@localhost ~]# iwconfig wlan0 key [3] 0123-4567-89
    [root@localhost ~]# iwconfig wlan0 key s:password [2]
    [root@localhost ~]# iwconfig wlan0 key [2]
    [root@localhost ~]# iwconfig wlan0 key open
    [root@localhost ~]# iwconfig wlan0 key off
    [root@localhost ~]# iwconfig wlan0 key restricted [3] 0123456789
    [root@localhost ~]# iwconfig wlan0 key 01-23 key 45-67 [4] key [4]

    power:设置无线网卡的电源管理模式。period ‘value’ 指定唤醒的周期,timeout‘value’指定进入休眠的等待时间,这两个参数之前可以加min和max修饰,这些值的单位为 秒,可以附加m和u来指定毫秒和微秒。off/on参数指定是否允许电源管理, all/unicast/multicast 指定允许唤醒的数据包类型。

    [root@localhost ~]# iwconfig wlan0 power period 2
    [root@localhost ~]# iwconfig wlan0 power 500m unicast
    [root@localhost ~]# iwconfig wlan0 power timeout 300u all
    [root@localhost ~]# iwconfig wlan0 power off
    [root@localhost ~]# iwconfig wlan0 power min period 2 power max period 4

    展开全文
  • iwconfig commands

    2017-09-14 13:21:19
    Iwconfig is similar to ifconfig(8), but is dedicated to the wireless interfaces. It is used to set the parameters of the network interface which are specific to the wireless operation

    Chinese Version 点击打开链接

    Description

    Iwconfig  is similar to  ifconfig(8) , but is dedicated to the wireless interfaces. It is used to set the parameters of the network interface which are specific to the wireless operation (for example : the frequency).  Iwconfig  may also be used to display those parameters, and the wireless statistics (extracted from  /proc/net/wireless ).

    All these parameters and statistics are device dependent. Each driver will provide only some of them depending on hardware support, and the range of values may change. Please refer to the man page of each device for details.

    Parameters

    essid
    Set the ESSID (or Network Name - in some products it may also be called Domain ID). The ESSID is used to identify cells which are part of the same virtual network.
    As opposed to the AP Address or NWID which define a single cell, the ESSID defines a group of cells connected via repeaters or infrastructure, where the user may roam transparently.
    With some cards, you may disable the ESSID checking (ESSID promiscuous) with  off or  any (and  on to reenable it).
    If the ESSID of your network is one of the special keywords ( offon or  any), you should use  -- to escape it.
    Examples :
    iwconfig eth0 essid any
    iwconfig eth0 essid
     "My Network""
    iwconfig eth0 essid -- "ANY""
    nwid
    Set the Network ID. As all adjacent wireless networks share the same medium, this parameter is used to differentiate them (create logical colocated networks) and identify nodes belonging to the same cell.
    This parameter is only used for pre-802.11 hardware, the 802.11 protocol uses the ESSID and AP Address for this function.
    With some cards, you may disable the Network ID checking (NWID promiscuous) with  off (and  on to reenable it).
    Examples :
    iwconfig eth0 nwid AB34
    iwconfig eth0 nwid off
    nick[name]
    Set the nickname, or the station name. Some 802.11 products do define it, but this is not used as far as the protocols (MAC, IP, TCP) are concerned and completely useless as far as configuration goes. Only some wireless diagnostic tools may use it.
    Example :
    iwconfig eth0 nickname "My Linux Node""
    mode
    Set the operating mode of the device, which depends on the network topology. The mode can be  Ad-Hoc (network composed of only one cell and without Access Point),  Managed (node connects to a network composed of many Access Points, with roaming),  Master (the node is the synchronisation master or acts as an Access Point),  Repeater (the node forwards packets between other wireless nodes),  Secondary (the node acts as a backup master/repeater),  Monitor (the node is not associated with any cell and passively monitor all packets on the frequency) or  Auto.
    Example :
    iwconfig eth0 mode Managed
    iwconfig eth0 mode Ad-Hoc
    freq/ channel
    Set the operating frequency or channel in the device. A value below 1000 indicates a channel number, a value greater than 1000 is a frequency in Hz. You may append the suffix k, M or G to the value (for example, "2.46G" for 2.46 GHz frequency), or add enough '0'.
    Channels are usually numbered starting at 1, and you may use  iwlist(8) to get the total number of channels, list the available frequencies, and display the current frequency as a channel. Depending on regulations, some frequencies/channels may not be available.
    When using Managed mode, most often the Access Point dictates the channel and the driver may refuse the setting of the frequency. In Ad-Hoc mode, the frequency setting may only be used at initial cell creation, and may be ignored when joining an existing cell.
    You may also use  off or  auto to let the card pick up the best channel (when supported).
    Examples :
    iwconfig eth0 freq 2422000000
    iwconfig eth0 freq 2.422G
    iwconfig eth0 channel 3
    iwconfig eth0 channel auto
    ap
    Force the card to register to the Access Point given by the address, if it is possible. This address is the cell identity of the Access Point, as reported by wireless scanning, which may be different from its network MAC address. If the wireless link is point to point, set the address of the other end of the link. If the link is ad-hoc, set the cell identity of the ad-hoc network.
    When the quality of the connection goes too low, the driver may revert back to automatic mode (the card selects the best Access Point in range).
    You may also use  off to re-enable automatic mode without changing the current Access Point, or you may use  any or  auto to force the card to reassociate with the currently best Access Point.
    Example :
    iwconfig eth0 ap 00:60:1D:01:23:45
    iwconfig eth0 ap any
    iwconfig eth0 ap off
    rate/ bit[rate]
    For cards supporting multiple bit rates, set the bit-rate in b/s. The bit-rate is the speed at which bits are transmitted over the medium, the user speed of the link is lower due to medium sharing and various overhead.
    You may append the suffix k, M or G to the value (decimal multiplier : 10^3, 10^6 and 10^9 b/s), or add enough '0'. Values below 1000 are card specific, usually an index in the bit-rate list. Use  auto to select automatic bit-rate mode (fallback to lower rate on noisy channels), which is the default for most cards, and  fixed to revert back to fixed setting. If you specify a bit-rate value and append  auto, the driver will use all bit-rates lower and equal than this value.
    Examples :
    iwconfig eth0 rate 11M
    iwconfig eth0 rate auto
    iwconfig eth0 rate 5.5M auto
    txpower
    For cards supporting multiple transmit powers, sets the transmit power in dBm. If  W is the power in Watt, the power in dBm is  P = 30 + 10.log(W). If the value is postfixed by  mW, it will be automatically converted to dBm.
    In addition,  on and  off enable and disable the radio, and  auto and  fixed enable and disable power control (if those features are available).
    Examples :
    iwconfig eth0 txpower 15
    iwconfig eth0 txpower 30mW
    iwconfig eth0 txpower auto
    iwconfig eth0 txpower off
    sens
    Set the sensitivity threshold. This define how sensitive is the card to poor operating conditions (low signal, interference). Positive values are assumed to be the raw value used by the hardware or a percentage, negative values are assumed to be dBm. Depending on the hardware implementation, this parameter may control various functions.
    On modern cards, this parameter usually control handover/roaming threshold, the lowest signal level for which the hardware remains associated with the current Access Point. When the signal level goes below this threshold the card starts looking for a new/better Access Point. Some cards may use the number of missed beacons to trigger this. For high density of Access Points, a higher threshold make sure the card is always associated with the best AP, for low density of APs, a lower threshold minimise the number of failed handoffs.
    On more ancient card this parameter usually controls the defer threshold, the lowest signal level for which the hardware considers the channel busy. Signal levels above this threshold make the hardware inhibits its own transmission whereas signals weaker than this are ignored and the hardware is free to transmit. This is usually strongly linked to the receive threshold, the lowest signal level for which the hardware attempts packet reception. Proper setting of these thresholds prevent the card to waste time on background noise while still receiving weak transmissions. Modern designs seems to control those thresholds automatically.

    Example :
    iwconfig eth0 sens -80
    iwconfig eth0 sens 2

    retry
    Most cards have MAC retransmissions, and some allow to set the behaviour of the retry mechanism.
    To set the maximum number of retries, enter  limit 'value'. This is an absolute value (without unit), and the default (when nothing is specified). To set the maximum length of time the MAC should retry, enter  lifetime 'value'. By defaults, this value in in seconds, append the suffix m or u to specify values in milliseconds or microseconds.
    You can also add the  shortlongmin and  max modifiers. If the card supports automatic mode, they define the bounds of the limit or lifetime. Some other cards define different values depending on packet size, for example in 802.11  min limit is the short retry limit (non RTS/CTS packets).
    Examples :
    iwconfig eth0 retry 16
    iwconfig eth0 retry lifetime 300m
    iwconfig eth0 retry short 12
    iwconfig eth0 retry min limit 8
    rts[_threshold]
    RTS/CTS adds a handshake before each packet transmission to make sure that the channel is clear. This adds overhead, but increases performance in case of hidden nodes or a large number of active nodes. This parameter sets the size of the smallest packet for which the node sends RTS ; a value equal to the maximum packet size disables the mechanism. You may also set this parameter to  autofixed or  off.
    Examples :
    iwconfig eth0 rts 250
    iwconfig eth0 rts off
    frag[mentation_threshold]
    Fragmentation allows to split an IP packet in a burst of smaller fragments transmitted on the medium. In most cases this adds overhead, but in a very noisy environment this reduces the error penalty and allow packets to get through interference bursts. This parameter sets the maximum fragment size which is always lower than the maximum packet size.
    This parameter may also control Frame Bursting available on some cards, the ability to send multiple IP packets together. This mechanism would be enabled if the fragment size is larger than the maximum packet size.
    You may also set this parameter to  autofixed or  off.
    Examples :
    iwconfig eth0 frag 512
    iwconfig eth0 frag off
    key/ enc[ryption]
    Used to manipulate encryption or scrambling keys and security mode.
    To set the current encryption key, just enter the key in hex digits as  XXXX-XXXX-XXXX-XXXX or  XXXXXXXX. To set a key other than the current key, prepend or append  [index] to the key itself (this won't change which is the active key). You can also enter the key as an ASCII string by using the  s:prefix. Passphrase is currently not supported.
    To change which key is the currently active key, just enter  [index] (without entering any key value).
    off and  on disable and reenable encryption.
    The security mode may be  open or  restricted, and its meaning depends on the card used. With most cards, in  open mode no authentication is used and the card may also accept non-encrypted sessions, whereas in  restricted mode only encrypted sessions are accepted and the card will use authentication if available.
    If you need to set multiple keys, or set a key and change the active key, you need to use multiple  keydirectives. Arguments can be put in any order, the last one will take precedence.
    Examples :
    iwconfig eth0 key 0123-4567-89
    iwconfig eth0 key [3] 0123-4567-89
    iwconfig eth0 key s:password [2]
    iwconfig eth0 key [2]
    iwconfig eth0 key open
    iwconfig eth0 key off
    iwconfig eth0 key restricted [3] 0123456789
    iwconfig eth0 key 01-23 key 45-67 [4] key [4]
    power
    Used to manipulate power management scheme parameters and mode.
    To set the period between wake ups, enter  period 'value'. To set the timeout before going back to sleep, enter  timeout 'value'. To set the generic level of power saving, enter  saving 'value'. You can also add the  min and  max modifiers. By default, those values are in seconds, append the suffix m or u to specify values in milliseconds or microseconds. Sometimes, those values are without units (number of beacon periods, dwell, percentage or similar).
    off and  on disable and reenable power management. Finally, you may set the power management mode to  all (receive all packets),  unicast (receive unicast packets only, discard multicast and broadcast) and  multicast (receive multicast and broadcast only, discard unicast packets).
    Examples :
    iwconfig eth0 power period 2
    iwconfig eth0 power 500m unicast
    iwconfig eth0 power timeout 300u all
    iwconfig eth0 power saving 3
    iwconfig eth0 power off
    iwconfig eth0 power min period 2 power max period 4
    modu[lation]
    Force the card to use a specific set of modulations. Modern cards support various modulations, some which are standard, such as 802.11b or 802.11g, and some proprietary. This command force the card to only use the specific set of modulations listed on the command line. This can be used to fix interoperability issues.
    The list of available modulations depend on the card/driver and can be displayed using  iwlist modulation. Note that some card/driver may not be able to select each modulation listed independantly, some may come as a group. You may also set this parameter to  auto let the card/driver do its best.
    Examples :
    iwconfig eth0 modu 11g
    iwconfig eth0 modu CCK OFDMa
    iwconfig eth0 modu auto
    commit
    Some cards may not apply changes done through Wireless Extensions immediately (they may wait to aggregate the changes or apply it only when the card is brought up via  ifconfig). This command (when available) forces the card to apply all pending changes.
    This is normally not needed, because the card will eventually apply the changes, but can be useful for debugging.

    Display

    For each device which supports wireless extensions,  iwconfig  will display the name of the  MAC protocol used (name of device for proprietary protocols), the  ESSID  (Network Name), the  NWID , the  frequency (or channel), the  sensitivity , the  mode  of operation, the  Access Point  address, the  bit-rate , the  RTS threshold , the  fragmentation threshold , the  encryption key  and the  power management  settings (depending on availability).

    The parameters displayed have the same meaning and values as the parameters you can set, please refer to the previous part for a detailed explanation of them.
    Some parameters are only displayed in short/abbreviated form (such as encryption). You may use iwlist(8)to get all the details.
    Some parameters have two modes (such as bitrate). If the value is prefixed by '=', it means that the parameter is fixed and forced to that value, if it is prefixed by ':', the parameter is in automatic mode and the current value is shown (and may change).

    Access Point/ Cell
    An address equal to 00:00:00:00:00:00 means that the card failed to associate with an Access Point (most likely a configuration issue). The  Access Point parameter will be shown as  Cell in ad-hoc mode (for obvious reasons), but otherwise works the same.

    If /proc/net/wireless exists, iwconfig will also display its content. Note that those values will depend on the driver and the hardware specifics, so you need to refer to your driver documentation for proper interpretation of those values.

    Link quality
    Overall quality of the link. May be based on the level of contention or interference, the bit or frame error rate, how good the received signal is, some timing synchronisation, or other hardware metric. This is an aggregate value, and depends totally on the driver and hardware.
    Signal level
    Received signal strength (RSSI - how strong the received signal is). May be arbitrary units or dBm,  iwconfig uses driver meta information to interpret the raw value given by  /proc/net/wireless and display the proper unit or maximum value (using 8 bit arithmetic). In  Ad-Hoc mode, this may be undefined and you should use  iwspy.
    Noise level
    Background noise level (when no packet is transmitted). Similar comments as for  Signal level.
    Rx invalid nwid
    Number of packets received with a different NWID or ESSID. Used to detect configuration problems or adjacent network existence (on the same frequency).
    Rx invalid crypt
    Number of packets that the hardware was unable to decrypt. This can be used to detect invalid encryption settings.
    Rx invalid frag
    Number of packets for which the hardware was not able to properly re-assemble the link layer fragments (most likely one was missing).
    Tx excessive retries
    Number of packets that the hardware failed to deliver. Most MAC protocols will retry the packet a number of times before giving up.
    Invalid misc
    Other packets lost in relation with specific wireless operations.
    Missed beacon
    Number of periodic beacons from the Cell or the Access Point we have missed. Beacons are sent at regular intervals to maintain the cell coordination, failure to receive them usually indicates that the card is out of range.
    展开全文
  • iwconfig工具源码

    2021-05-13 15:25:42
    iwconfig工具源码 在自己的Win10,开启了【适用于Linux的Windows子系统】功能; 再到应用商店下载kali linux,发现没有iwconfig可用。 Github有开源项目,没必要去付费下载: ...打包下载到本地后,用51cto上...
  • iwconfig工具

    千次阅读 2013-07-22 12:45:06
    iwconfig 注意:radio层不支持该命令,该命令只在协议层使用。 用途:用于设置和操作WLAN接口,方法与ifconfig类似,但是是用于指定802.11设备的操作。 格式:iwconfig interface  [essid {X|on|off
  • kali之iwconfig

    千次阅读 2019-12-28 21:47:29
    iwconfig类似于ifconfig(8),但专门用于无线接口。它用于设置特定于无线操作的网络接口的参数(例如:频率)。还可以使用iwconfig来显示这些参数和无线统计信息(从/proc/net/wireless中提取)所有这些参数和统计数据都...
  • iwconfig用法

    2014-09-02 19:13:54
    iwconfig是Linux WirelessExtensions(LWE)的用户层配置工具之一。LWE是Linux下对无线网络配置的工具,包括内核的支持、用户层配置工具和驱动接口的支持三部分。目前很多无线网卡都支持LWE,而且主流的Linux发布版本...
  • iwconfig源代码

    热门讨论 2009-07-02 19:08:37
    iwconfig是linux对无线网卡比较常用的工具
  • iwlist iwconfig

    千次阅读 2013-07-22 06:16:38
    iwconfig是Linux Wireless Extensions(LWE)的用户层配置工具之一。LWE是Linux下对无线网络配置的工具,包括内核的支持、用户层配置工具和驱动接口的支持三部分。目前很多无线网卡都支持LWE,而且主流的Linux发布版本...
  • iwconfig android

    千次阅读 2014-04-07 18:16:52
    iwconfig工具使用  下载iwconfig工具相关的源代码,并成功交叉编译通过,用于实际项目中。 可依据实际需要修改Makefile中的"CC=gcc","AR=ar"以及安装路径, 我是CC=$(TOOLCHAIN)/bin/arm-linux-gcc,和AR=$...
  • iwconfig 使用

    千次阅读 2013-03-15 13:57:52
    iwconfig iwconfig是Linux Wireless Extensions(LWE)的用户层配置工具之一。LWE是Linux下对无线网络配置的工具,包括内核的支持、用户层配置工具和驱动接口的支持三部分。目前很多无线网卡都支持LWE,而且主流的...
  • iwconfig 命令

    2014-01-25 00:51:01
    Iwconfig命令使用: iwconfig是Linux Wireless Extensions(LWE)的用户层配置工具之一。LWE是Linux下对无线网络配置的工具,包括内核的支持、用户层配置工具和驱动接口的支持三部分。目前很多无线网卡都支持LWE,...
  • iwconfig 用法

    千次阅读 2014-01-10 09:02:42
    iwconfig工具使用  下载iwconfig工具相关的源代码,并成功交叉编译通过,用于实际项目中。 可依据实际需要修改Makefile中的"CC=gcc","AR=ar"以及安装路径, 我是CC=$(TOOLCHAIN)/bin/arm-linux-gcc,和AR=$...
  • iwconfig的用法

    2017-10-13 14:35:53
    iwconfig wlan0 txpower on 2. 列出区域内的无线网络 iwlist wlan0 scan 3. 假设要连接到网络MyHome(即essid为MyHome的网络),那么输入命令 iwconfig wlan0 essid “MyHome”  如果网络是加密的,密码是...
  • linux 无线网卡命令iwlist iwconfig iw.pdf
  • iwconfig配置

    千次阅读 2012-05-16 14:46:21
    iwconfig [interface] iwconfig interface [essid X] [nwid N] [mode M] [freq F] [channel C][sens S ][ap A ][nick NN ] [rate R] [rts RT] [frag FT
  • wireless_tools.29常用的网络工具,包含iwconfig等常用命令
  • Linux笔记-iwconfig

    2019-05-03 16:27:08
    iwconfig 作用:获取无线配置 格式:iwconfig [设备][参数] 注意:这是Ubuntu上的命令,RHEL没有!!!
  • iwconfig手册页

    千次阅读 2013-07-22 12:49:17
    $ man iwconfig IWCONFIG(8) Linux Programmer's Manual IWCONFIG(8) NAME  iwconfig - configure a wireless

空空如也

空空如也

1 2 3 4 5 ... 20
收藏数 8,091
精华内容 3,236
关键字:

iwconfig