Chinaunix首页 | 论坛 | 博客
  • 博客访问: 709017
  • 博文数量: 130
  • 博客积分: 10
  • 博客等级: 民兵
  • 技术积分: 2198
  • 用 户 组: 普通用户
  • 注册时间: 2011-11-29 12:48
个人简介

每一个“丑得人神共愤”的泡妞高 手都有一颗坚忍的心,这证明了人类 在绝境中毫不妥协的求生精神,反正丑都丑了,索性放开手脚大干一场,这就叫“无产阶级失去的是锁链,得到的是全世界”

文章分类

全部博文(130)

文章存档

2013年(130)

我的朋友

分类: LINUX

2013-05-21 11:15:27

说明,本文翻译自man iwconfig,若遇到不能理解的地方请参考man文档
概述
       iwconfig用于配置无线网络接口
使用方法
       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] [txpower T]
                          [enc E] [key K] [power P] [retry R]
                          [modu M] [commit]
       iwconfig --help
       iwconfig --version
描述
    iwconfig类似于ifconfig但专注于无线网络接口的查看和配置。
参数
       essid  设置无线网卡的ESSID(Extension Service Set ID)。通过ESSID来区分不同的无线网络,正常情况下只有相同ESSID的无线站点才可以互相通讯,除非想监听无线网络。其后的参数为双引号括起的ESSID字符串,或者是any/on/off,如果ESSID字符串中包含any/on/off,则需要在前面加"--"。

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

       nick[name]
              设置nickname或station名。一些网卡需要设置该参数,但是802.11协议栈、MAC都没有用到该参数,一般也不用设置

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

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

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

       rate/bit[rate]
              如果无线网卡支持多速率,则可以通过该命令设置工作的速率。小于1000的参数由具体的无线网卡驱动定义,一般是传输速率的索引值,大于1000的为速率,单位bps,可以在数字后面附带k, M, G来指定数量级。auto参数让无线网卡自动选择速率,fixed参数让无线网卡不使用自动速率模式。
       txpower
              如果无线网卡支持多发射功率设定,则使用该参数设定发射,单位为dBm,如果指定为W(毫瓦),则转换公式为:dBm=30+log(W)。参数on/off可以打开和关闭发射单元,auto和fixed指定无线是否自动选择发射功率。

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

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

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

       frag[mentation_threshold]
              设置发送数据包的分片大小。设置分片会增加额外开销,但在噪声环境下可以提高数据包的到达率。一般情况下该参数小于最大包大小,有些支持Burst模式的无线网卡可以设置大于最大包大小的值来允许Burst模式。还可以使用auto/fixed/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字符表示。

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

       modu[lation]
              强制无线网卡使用指定的调制方式(modulations)。可用的调制方式(modulations)可使用iwlist modulation查看。

       commit 提交所有的参数修改给无线网卡驱动。有些无线网卡驱动会先缓存无线网卡参数修改,使用这个命令来让无线网卡的参数修改生效。不过一般不需要使用该命令,因为无线网卡驱动最终都会使参数的修改生效,一般在debug时会用到。为了方便配置,可以把配置写到 /etc/network/interfaces中,这样以后就不用反复配置了。

DISPLAY
       对于支持无线扩展的设备,iwconfig可显示使用的MAC协议名,ESSID,NWID,频率,灵敏度,模式,AP地址,速率,RTS/CTS握手方式,发送数据包的分片大小, 加密key和电源管理设置。有些参数使用缩写的方式显示,可通过iwlist获取相应的细节。有些参数有两种模式(如速率),如果参数以'='开头,表示参数是固定值;如果参数以':'开头表示是自动模式,其值为当前值。

       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 configura‐
              tion 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 hard‐
       ware 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  giv‐
              ing 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.
阅读(3488) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~