Iwconfig is one of the User-layer configuration tools for Linux wireless extensions (LWE. LWE is a tool for wireless network configuration in Linux, including Kernel support, user-layer Configuration tool, and Driver Interface Support. At present, many wireless network cards support LWE, and mainstream Linux versions, such as RedHat Linux and Ubuntu Linux, have already brought this configuration tool.
Usage: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]
Note: iwconfig is the most important tool for LWE. You can configure most parameters of the wireless network card.
Parameters:
Essid: Set the Essid (Extension Service Set ID) of the wireless network adapter ). Essid is used to distinguish different wireless networks. Normally, only wireless sites with the same Essid can communicate with each other unless you want to listen to the wireless network. The following parameter is an Essid string enclosed by double quotation marks, or any/ON/OFF. If the Essid string contains any/no/off, add "--".
Example:
# Iwconfig eth0 Essid any allows any Essid, that is, the hybrid mode
# Iwconfig eth0 Essid "My network" set Essid to "my network"
# Iwconfig eth0 Essid -- "any" set Essid to "any"
Nwid: network ID, used only for the wireless network card of the pre-802.11, 802.11 Nic uses Essid and MAC address of AP to replace nwid, now basically do not need to set.
Example:
# Iwconfig eth0 nwid ab34
# Iwconfig eth0 nwid off
NICK: nickname. This parameter must be set for some NICs, but is not used for the 802.11 protocol stack and Mac.
Example:
# Iwconfig eth0 nickname "My Linux node"
Mode: Set the working mode of the wireless network card. It can be
Ad-hoc: point-to-point wireless network without AP
Managed: a network composed of multiple APs, which allows wireless devices to roam.
MASTER: sets the wireless network card as an AP
Repeater: set as a wireless network relay device to forward network packets.
Secondary: set as the backup AP/Repeater
Monitor: listening mode
Auto: the working mode is automatically selected by the wireless network adapter.
Example:
# Iwconfig eth0 mode managed
# Iwconfig eth0 mode ad-hoc
Freq/channel: set the frequency or channel of the wireless network adapter. A parameter smaller than 1000 is considered as a channel, and a parameter greater than 10000 is considered as a frequency. The unit of frequency is Hz. K can be attached to a number,
M, g to change the order of magnitude, such as 2.4g. The channel starts from 1. You can use the lwlist tool to view the frequency and channel supported by the wireless network card. The off/auto parameter indicates the automatic selection frequency of the wireless network.
Note: In managed mode, the AP indicates the working frequency of the wireless network adapter. Therefore, the parameters set in this mode are ignored.
In ad-hoc mode, only the specified frequency is used for the initial wireless network. If an existing ad-hoc network is added
The specified frequency parameter is ignored.
Example:
# Iwconfig eth0 freq2422000000
# Iwconfig eth0 freq 2.422g
# Iwconfig eth0 Channel 3
# Iwconfig eth0 Channel Auto
AP: connect to the specified AP or wireless network. The following parameters can be the MAC address of the AP or the identifier of iwlist scan. If it is ad-hoc, an existing ad-hoc network is connected. Use the off parameter to enable the wireless network adapter to enter the automatic mode without changing the connected AP. Any/auto parameter. The wireless network card automatically selects the best AP.
Note: If the wireless signal is low to a certain extent, the wireless network will automatically select the AP mode.
Example:
# Iwconfig eth0 AP 00: 60: 1D: 01: 23: 45
# Iwconfig eth0 AP any
# Iwconfig eth0 AP off
Rate/bit: If the wireless network card supports multiple rates, you can use this command to set the working rate. A parameter smaller than 1000 is defined by a specific wireless network card driver. It is generally the index value of the transmission rate. If it is greater than 1000, the speed is measured in BPS. K, M, and, g to specify the order of magnitude. The auto parameter allows the wireless network adapter to automatically select the rate fixed parameter so that the wireless network adapter does not use the automatic rate mode.
Example:
# Iwconfig eth0 rate 11 m
# Iwconfig eth0 rate auto
# Iwconfig eth0 rate 5.5 m auto // automatically select the rate below 5 MB
Txpower: If the wireless network card supports multiple transmit power settings, use this parameter to set the transmit unit to dBm. If it is specified as W (MW), only the conversion formula is as follows: DBM = 30 + Log (W ). The on/off parameter can be used to enable or disable the transmitting unit. Auto and fixed specify whether the transmitting power is automatically selected for the wireless device.
Example:
# Iwconfig eth0 txpower 15
# Iwconfig eth0 txpower 30 MW
# Iwconfig eth0 txpower auto
# Iwconfig eth0 txpower off
SENS: Set the lower limit of the receiver sensitivity. Under this lower limit, the wireless network adapter determines that the wireless network signal is too bad. Different network adapters will take different measures, some modern wireless NICS will automatically select a new AP. The positive parameter is raw data, which is directly transmitted to the wireless NIC Driver for processing. This is generally considered as a percentage. A negative value indicates the DBM value.
Example:
# Iwconfig eth0 sens-80
# Iwconfig eth0 sens 2
Retry: Set the retransmission mechanism of the wireless network adapter. Limit 'value' specifies the maximum number of retransmissions. Lifetime 'value' specifies the maximum retry time, in seconds. You can use M and u to specify the unit in milliseconds and microseconds. If the wireless network adapter supports automatic mode, you can add min and max before limit and lifetime to specify the upper and lower limits.
Example:
# Iwconfig eth0 retry 16
# Iwconfig eth0 retry lifetime 300 m
# Iwconfig eth0 retry min limit 8
RTS: Specifies the RTS/CTS handshake mode. Using the RTS/CTS handshake will increase the overhead, but performance can be improved if there are hidden wireless nodes or many wireless nodes in the wireless network. The following parameter specifies the minimum package size using this mechanism. If this value is equal to the maximum package size, this mechanism is not allowed. You can use the Auto/Off/fixed parameter.
Example:
# Iwconfig eth0 RTS 250
# Iwconfig eth0 RTS off
Frag: Set the shard size of the sent data packet. Setting shards increases the overhead, but increases the packet arrival rate in a noisy environment. Generally, this parameter is smaller than the maximum package size. For some wireless NICs that support the burst mode, you can set a value greater than the maximum package size to allow the burst mode. You can also use the Auto/fixed/off parameter.
Example:
# Iwconfig eth0 frag 512
# Iwconfig eth0 frag off
Key/ENC [ryption]: Set the encryption key used by the wireless network adapter. Here is the encryption key for WEP mode. To use WPA, you need the wpa_supplicant Toolkit (wireless_tool_2.9 now supports WPA ). Key parameters can be hexadecimal values in XXXX-XXXX-XXXX-XXXX or XXXXXXXX format, or ASCII characters in S: xxxxxx. If [Index] is added before the key parameter, only the key corresponding to the index value is set and the current key is not changed. You can directly specify the [Index] value to set which key is currently used. You can specify on/off to determine whether to use the encryption mode. Open/restricted specifies the encryption mode, depending on different wireless network adapters. Most wireless network adapters do not use encryption in the open mode and are allowed to receive unencrypted data packets. The restricted mode uses encryption. Multiple key parameters can be used, but only the last one takes effect. The WEP key can be 40 bits, expressed by 10 hexadecimal digits or 5 ASCII characters, or bits, expressed by 26 hexadecimal digits or 13 ASCII characters.
Example:
# 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: Set the power management mode of the wireless network card. Period 'value' specifies the wake-up period, and timeout 'value' specifies the waiting time for sleep. Before the two parameters, you can add min and max. These values are measured in seconds, you can append m and u to specify milliseconds and microseconds. The off/on parameter specifies whether to allow power management. The All/unicast/multicast parameter specifies the data packet type that can be awakened.
Example:
# Iwconfig eth0 power period 2
# Iwconfig eth0 power 500 m unicast
# Iwconfig eth0 power timeout 300u all
# Iwconfig eth0 power off
# Iwconfig eth0 power min period 2 power Max period 4
Commit: Submit all parameters to the wireless NIC Driver. Some wireless network card drivers cache the parameter repair of the wireless network card. Use this command to make the parameter modification of the wireless network card take effect. However, you generally do not need to use this command, because the wireless NIC driver will eventually take effect with the parameter modification, which is generally used in debug.