命令行大全

iwconfig

瑞兹 发表于 2021-01-27 09:10浏览次数:

在Linux操作系统上,iwconfig命令可配置无线网络接口。

查看英文版

目录:

1 iwconfig 运行系统环境

2 iwconfig 描述

3 iwconfig 语法

4 iwconfig 例子

iwconfig 运行系统环境

Unix&Linux

iwconfig 描述

Iwconfig与ifconfig相似,但专用于无线接口。它用于设置特定于无线操作的网络接口参数(例如,无线频率)。Iwconfig也可以用于显示那些参数和无线统计信息(从/ proc / net / wireless中提取)。

所有这些参数和统计信息均取决于设备。每个驱动程序将仅提供其中一些驱动程序,具体取决于硬件支持,并且值的范围可能会更改。有关详细信息,请检查每个设备的手册页。

Iwconfig is similar to ifconfig, but is dedicated to the wireless interfaces. It is used to set the parameters of the network interface that are specific to the wireless operation (the wireless frequency, for example). 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. Check the man page of each device for details.

查看英文版

查看中文版

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

参量

小费

有关这些参数的扩展说明以及每个参数的示例,请参见示例。

essid

设置ESSID(或网络名称-在某些产品中也可能称为域ID)。

nwid

设置网络ID。

nick

设置昵称或电台名称。

mode

设置设备的操作模式,具体取决于网络拓扑。

freq/channel

在设备中设置工作频率或信道。

ap

如有可能,强制将卡注册到该地址给定的访问点。

rate/bit

对于支持多种比特率的卡,将比特率设置为b / s。

txpower

对于支持多种发射功率的卡,以dBm为单位设置发射功率。

sens

设置灵敏度阈值。这定义了卡对不良操作条件(低信号,干扰)的敏感程度。

retry

设置MAC可以重试传输的最大次数。

rts

RTS / CTS在每次发送数据包之前添加一次握手,以确保通道畅通。

frag

设置最大片段大小,该大小始终小于最大数据包大小。

key/enc

用于操纵加密或加扰密钥和安全模式。

power

用于操纵电源管理方案的参数和模式。

modu

强制卡使用一组特定的调制。

commit

强制卡应用所有待处理的更改。

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

Parameters

Tip

For an extended description of these parameters and examples of each, see the examples.

essid

Set the ESSID (or Network Name - in some products it may also be called Domain ID).

nwid

Set the Network ID.

nick

Set the nickname, or the station name.

mode

Set the operating mode of the device, which depends on the network topology.

freq/channel

Set the operating frequency or channel in the device.

ap

Force the card to register to the access point given by the address, if it is possible.

rate/bit

For cards supporting multiple bit rates, set the bitrate in b/s.

txpower

For cards supporting multiple transmit powers, sets the transmit power in dBm.

sens

Set the sensitivity threshold. This defines how sensitive is the card to poor operating conditions (low signal, interference).

retry

Set the maximum number of times the MAC can retry transmission.

rts

RTS/CTS adds a handshake before each packet transmission to make sure that the channel is clear.

frag

Sets the maximum fragment size, which is always lower than the maximum packet size.

key/enc

Used to manipulate encryption or scrambling keys and security mode.

power

Used to manipulate power management scheme parameters and mode.

modu

Force the card to use a specific set of modulations.

commit

Forces the card to apply all pending changes.

查看英文版

查看中文版

iwconfig 例子

例子

iwconfig eth0 essid any
iwconfig eth0 essid "My Network"
iwconfig eth0 essid -- "ANY"

essid设置 ESSID(或网络名称 - 在某些产品中,它也可能称为域 ID)。ESSID 用于标识同一虚拟网络的单元。

与定义单个单元的 AP 地址或 NWID 相比,ESSID 定义了一组通过中继器或基础结构连接的单元,用户可以在其中透明地漫游。

对于某些卡,您可以禁用 ESSID 检查(ESSID 混杂)与关闭或任何和上重新启用它)。

如果您的网络的 ESSID 是特殊关键字之一(关闭打开或任何),您应该使用-- 来转义它。

例子

iwconfig eth0 nwid AB34
iwconfig eth0 nwid off

nwid设置网络 ID。由于所有相邻的无线网络共享相同的介质,因此此参数用于区分它们(创建逻辑并分网络)并标识属于同一单元的节点。

此参数仅用于 802.11 之前硬件,802.11 协议使用此函数的 ESSID 和 AP 地址。

对于某些卡,您可以禁用网络 ID 检查(NWID 混杂)关闭并打开以重新启用它)。

例子

iwconfig eth0 nickname "My Linux Node"

nick设置昵称或站名称。一些 802.11 产品确实定义了它,但就协议(MAC、IP、TCP)而言,这一点并不使用,在配置方面则完全没用。只有某些无线诊断工具可以使用它。

例子

iwconfig eth0 mode Managed
iwconfig eth0 mode ad hoc

mode设置设备的操作模式,这取决于网络拓扑。该模式可以是临时的(网络仅由一个单元组成且没有接入点)、托管(节点连接到由多个接入点组成的网络,具有漫游功能)、Master(节点是同步主机或充当接入点)、继器(节点在其他无线节点之间转发数据包)、辅助(节点充当备份主/中继器)、监视器(节点不与任何单元关联且被动监视频率上的所有数据包)或"自动"。

freq/通道示例

iwconfig eth0 freq 2422000000
iwconfig eth0 freq 2.422G
iwconfig eth0 channel 3
iwconfig eth0 channel auto

freq 和channel道分别设置设备中的工作频率或通道。低于 1000 的值表示通道数,大于 1000 的值是 Hz 中的频率。您可以将后缀 k、M 或 G 追加到值(例如,2.46 GHz 频率的"2.46G")或添加足够的"0"。

通道通常从 1 开始编号,您可以使用iwlist获取通道总数、列出可用频率以及将当前频率显示为通道。根据规定,某些频率/通道可能不可用。

使用托管模式时,接入点通常指示通道,驱动程序可能会拒绝频率设置。在临时模式下,频率设置只能在初始单元格创建时使用,并且在加入现有单元格时可能会忽略。

您还可以使用关闭或自动让卡拾取最佳通道(在受支持时)。

例子

iwconfig eth0 ap 00:60:1D:01:23:45
iwconfig eth0 ap any
iwconfig eth0 ap off

如果可能,ap强制卡注册到地址给出的接入点。此地址是接入点的单元标识,如无线扫描报告,可能不同于其网络 MAC 地址。如果无线链路是点对点,请设置链路另一端的地址。如果链接是临时的,则设置临时网络的单元格标识。当连接质量过低时,驱动程序可能会恢复到自动模式(卡选择范围内的最佳接入点)。您还可以使用OFF 重新启用自动模式而不更改当前接入点,或者您可以使用任何或自动强制卡与当前最佳接入点重新关联。

速率/位示例

iwconfig eth0 rate 11M
iwconfig eth0 rate auto
iwconfig eth0 rate 5.5M auto

对于支持多个比特率的卡,速率以 b/s 表示比特率。比特率是位通过介质传输的速度,由于介质共享和各种开销,链路的用户速度较低。

您可以将后缀 k、M 或 G 追加到值(十进制乘数 :10^3、10^6 和 10^9 b/s)中,或添加足够的"0"。低于 1000 的值是特定于卡的,通常是比特率列表中的索引。使用自动选择自动比特率模式(回退到噪声通道上的较低速率),这是大多数卡的默认值并固定为恢复到固定设置。如果指定比特率值并追加自动,则驱动程序将使用低于 和 等于此值的所有比特率。

例子

iwconfig eth0 txpower 15
iwconfig eth0 txpower 30mW
iwconfig eth0 txpower auto
iwconfig eth0 txpower off

对于支持多个传输功率的卡,txpower以 dBm 设置传输功率。如果 W 是瓦特中的功率,则 dBm 中的功率为 P = 30 = 10.log(W)。如果该值由mW 后缀,则将自动转换为 dBm。

此外,开和关启用和禁用收音机,以及自动和固定启用和禁用电源控制(如果这些功能可用)。

感官示例

iwconfig eth0 sens -80
iwconfig eth0 sens 2

sen 设置灵敏度阈值。这定义了卡对恶劣工作条件(低信号、干扰)的敏感性。正值假定为硬件使用的原始值或百分比,负值假定为 dBm。根据硬件实现,此参数可以控制各种功能。

在现代卡上,此参数通常控制切换/漫游阈值,这是硬件与当前接入点保持关联的最低信号电平。当信号电平低于此阈值时,卡开始寻找新的/更好的接入点。某些卡可能会使用错过的信标数量来触发此事件。对于高密度接入点,较高的阈值确保卡始终与最佳 AP 关联,对于低密度的 AP,较低的阈值可最大限度地减少失败的切换数量。

在更古老的卡片上,此参数通常控制延迟阈值,即硬件认为通道忙的最低信号电平。超过此阈值的信号电平使硬件抑制其自身的传输,而弱于此的信号将被忽略,并且硬件可以自由传输。这通常与接收阈值(硬件尝试数据包接收的最低信号电平)紧密相连。正确设置这些阈值可防止卡在仍然接收弱传输时浪费时间在背景噪音上。现代设计似乎自动控制这些阈值。

重试示例

iwconfig eth0 retry 16
iwconfig eth0 retry lifetime 300m
iwconfig eth0 retry short 12
iwconfig eth0 retry min limit 8

大多数卡具有 MAC 重新传输,有些允许设置重试机制的行为

要设置最大重数,请输入限制"值"。这是一个绝对值(不带单位),也是默认值(未指定任何操作时)。要设置 MAC 应重试的最大时间长度,请输入生存期"值"。默认情况下,此值以秒为单位,追加后缀 m 或指定值(以毫秒或微秒为单位)。

您还可以添加短、长最小和最大修改器。如果卡支持自动模式,则它们定义限制或生存期的限制。其他一些卡根据数据包大小定义不同的值,例如在 802.11分钟限制中是短重试限制(非 RTS/CTS 数据包)。

rts 示例

iwconfig eth0 rts 250
iwconfig eth0 rts off

rts在每次数据包传输之前添加握手,以确保通道清晰。这会增加开销,但在隐藏节点或大量活动节点的情况下提高性能。此参数设置节点向其发送 RTS 的最小数据包的大小;等于最大数据包大小的值将禁用该机制。您还可以将此参数设置为自动固定或关闭。

碎片示例

iwconfig eth0 frag 512
iwconfig eth0 frag off

碎片允许设备在介质上传输的较小片段中拆分 IP 数据包。在大多数情况下,这会增加开销,但在非常嘈杂的环境中,这会减少错误损失,并允许数据包通过干扰突发。此参数设置始终低于最大数据包大小的最大片段大小。此参数还可以控制某些卡上可用的帧突发,即将多个 IP 数据包一起发送的能力。如果片段大小大于最大数据包大小,则将启用此机制。您还可以将此参数设置为自动固定或关闭

键/enc 示例

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]

密钥用于操作加密或争用密钥和安全模式。要设置当前加密密钥,请以十六进制数字输入密钥XXXX-XXXX- XXXX-XXXXXXXXXXXX要设置当前键以外的键,请预附或追加[索引]到密钥本身(这不会改变什么是活动键)。还可以使用s:前缀将密钥输入为 ASCII 字符串。当前不支持密码短语。

要更改哪个键是当前活动键,请输入[索引](不输入任何键值)。

offon禁用和重新启用加密。安全模式可能是打开的或受限的,其含义取决于使用的卡。对于大多数卡,在打开模式下不使用身份验证,并且卡也可能接受非加密会话,而在受限模式下,仅接受加密会话,并且卡将使用身份验证(如果可用)。如果需要设置多个键,或设置密钥并更改活动密钥,则需要使用多个键指令。参数可以按任何顺序排列,最后一个参数优先。

例子

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

电源用于操作电源管理方案参数和模式。要设置唤醒之间的期间,请输入期间"值"。若要在返回睡眠状态之前设置超时,请输入超时"值"。要设置一般省电级别,请输入节省"值"。您还可以添加最小值和最大值修改器。默认情况下,这些值以秒为单位,追加后缀 m 或指定值(以毫秒或微秒为单位)。有时,这些值没有单位(信标周期数、停留时间数、百分比或类似值数)。

关闭和打开禁用和重新启用电源管理。最后,您可以设置电源管理模式到所有(接收所有数据包)、单播(仅接收单播数据包、丢弃多播和广播)和多播(仅接收多播和广播、丢弃单播数据包)。

例子

iwconfig eth0 modu 11g
iwconfig eth0 modu CCK OFDMa
iwconfig eth0 modu auto

modu强制卡使用一组特定的调制。现代卡支持各种调制,有些是标准的,如802.11b或802.11g,有些是专有的。此命令强制卡仅使用命令行上列出的特定调制集。这可用于修复互操作性问题。可用调制列表取决于卡/驱动程序,可以使用iwlist 调制显示。请注意,某些卡/驱动程序可能无法选择独立列出的每个调制,有些可能作为一个组来。您还可以将此参数设置为自动,以让卡/驱动程序尽力而为。

例子

iwconfig commit

某些卡可能不会立即应用通过无线扩展完成的更改(他们可能等待聚合更改或仅在通过ifconfig提起卡时应用更改)。此命令(如果可用)强制卡应用所有挂起的更改。

这通常不需要,因为卡最终会应用更改,但可用于调试。

显示的内容

对于支持无线扩展的每个设备,iwconfig 将显示使用的 MAC 协议的名称(专有协议的设备名称)、ESSID(网络名称)、NWID、频率(或通道)、灵敏度、操作模式、接入点地址、比特率、RTS 阈值、碎片阈值、加密密钥和电源管理设置(取决于可用性)。

显示的参数的含义和值与可以设置的参数相同;有关其详细说明,请参阅上一部分。

某些参数仅以短/缩写形式显示(如加密)。您可以使用iwlist获取所有详细信息。某些参数有两种模式(如比特率)。如果该值以"+"为前缀,则意味着该参数已固定并强制为该值,如果该参数的前缀为":",则该参数处于自动模式,并且显示当前值(并且可能会更改)。

接入点/单元

等于 00:00:00:00:00:00 的地址表示卡未能与接入点关联(很可能是配置问题)。接入点参数将在临时模式下显示为单元格(原因明显),但以其他方式工作相同。

如果存在 /proc/net/无线,iwconfig也会显示其内容。请注意,这些值将取决于驱动程序和硬件细节,因此您需要参考驱动程序文档以正确解释这些值。

链接质量

链接的整体质量。可能基于争用或干扰级别、位或帧错误率、接收信号的多少、一些定时同步或其他硬件指标。这是一个聚合值,完全取决于驱动程序和硬件。

信号电平

接收信号强度(RSSI - 接收信号的强度)。可能是任意单位或dBm,iwconfig使用驱动程序元信息来解释/proc/net/无线给出的原始值,并显示正确的单位或最大值(使用 8 位算术)。在临时模式下,这可能是未定义的,您应该使用iwspy。

噪音水平

背景噪声级别(当没有数据包传输时)。信号电平的类似评论

Rx 无效 nwid

使用其他 NWID 或 ESSID 接收的数据包数。用于检测配置问题或相邻网络存在(频率相同)。

Rx 无效的加密

硬件无法解密的数据包数。这可用于检测无效的加密设置。

Rx 无效碎片

硬件无法正确重新组装链路层片段的数据包数(很可能缺少一个)。

Tx 过度重

硬件无法传递的数据包数。大多数 MAC 协议在放弃之前会多次重试数据包。

无效

与特定无线操作相关的其他数据包丢失。

错过的信标

来自单元或我们错过的接入点的定期信标数。信标定期发送以保持单元协调,未接收信标通常表示卡范围不一。

Examples

iwconfig eth0 essid any
iwconfig eth0 essid "My Network"
iwconfig eth0 essid -- "ANY"

essid sets the ESSID (or Network Name - in some products it may also be called Domain ID). The ESSID is used to identify cells that 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 nwid AB34
iwconfig eth0 nwid off

nwid sets the Network ID. As all adjacent wireless networks share the same medium, this parameter is used to differentiate them (create logical collocated 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 nickname "My Linux Node"

nick sets 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.

Examples

iwconfig eth0 mode Managed
iwconfig eth0 mode ad hoc

mode sets 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.

freq/channel examples

iwconfig eth0 freq 2422000000
iwconfig eth0 freq 2.422G
iwconfig eth0 channel 3
iwconfig eth0 channel auto

freq and channel set the operating frequency or channel in the device, respectively. 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 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 ap 00:60:1D:01:23:45
iwconfig eth0 ap any
iwconfig eth0 ap off

ap forces 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 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.

rate/bit examples

iwconfig eth0 rate 11M
iwconfig eth0 rate auto
iwconfig eth0 rate 5.5M auto

For cards supporting multiple bit rates, rate sets the bitrate in b/s. The bitrate 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 bitrate list. Use auto to select automatic bitrate mode (fallback to lower rate on noisy channels), which is the default for most cards, and fixed to revert to fixed setting. If you specify a bitrate value and append auto, the driver will use all bitrates lower than and equal to this value.

Examples

iwconfig eth0 txpower 15
iwconfig eth0 txpower 30mW
iwconfig eth0 txpower auto
iwconfig eth0 txpower off

For cards supporting multiple transmit powers, txpower 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).

sens examples

iwconfig eth0 sens -80
iwconfig eth0 sens 2

sens sets 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.

retry examples

iwconfig eth0 retry 16
iwconfig eth0 retry lifetime 300m
iwconfig eth0 retry short 12
iwconfig eth0 retry min limit 8

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 is 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).

rts example

iwconfig eth0 rts 250
iwconfig eth0 rts off

rts 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.

frag example

iwconfig eth0 frag 512
iwconfig eth0 frag off

frag allows the device 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 that 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.

key/enc 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]

key is used to manipulate encryption or scrambling keys and security mode. To set the current encryption key, 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 what 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, 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 key directives. Arguments can be put in any order, and the last one takes precedence.

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

power is 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 modu 11g
iwconfig eth0 modu CCK OFDMa
iwconfig eth0 modu auto

modu forces the card to use a specific set of modulations. Modern cards support various modulations, some that 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 independently, some may come as a group. You may also set this parameter to auto to let the card/driver do its best.

Examples

iwconfig 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.

What Is displayed

For each device which supports wireless extensions, iwconfig displays 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 bitrate, 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 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 many 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.

查看英文版

查看中文版

发表评论
评论列表
共0条
点击加载更多