Linux Command to set wireless connection

Source: Internet
Author: User


Linux Command set Wireless connection use iwconfig command javasiwconfig wlan0 essid "SPAEK" iwconfig wlan key s: liude0000123 dhclient wlan0 guest iwconfig is one of the User-layer configuration tools of 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. Www.2cto.com 1. iwconfig 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] Description: iwconfig is the main tool of LWE. Line configuration. Parameter: essid: Set the ESSID (Extension Service Set ID) of the wireless network card ). 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" sets ESSID to "My Network" # iwconfig eth0 essid -- "ANY" sets ESSID to "ANY" nwid: Network ID, only for wireless network card pre-802.11, 802.11 Network Card Using ESSID and ap mac address to replace nwid, now basically do not need to set. Example: www.2cto.com # iwconfig eth0 nwid AB34 # iwconfig eth0 nwid off nick: Nickname. You need to set this parameter for some NICs, but this parameter is not used for both the 802.11 protocol stack and MAC, generally, you do not need to set it. Example: # iwconfig eth0 nickname "My Linux Node" mode: sets the working mode of the wireless network adapter, which can be Ad-hoc: point-to-point wireless network Managed without AP: through a network composed of multiple APs, wireless devices can roam the Master in this network: Set the wireless network card to an AP Repeater: set to a wireless network relay device, you can forward the Network Package Secondary: AP/Repeater Monitor: monitoring 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 working 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, M, and G can be attached to a number to change the order of magnitude, for example, 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 configured frequency parameter is ignored. Example: # iwconfig eth0 freq 2422000000 # iwconfig eth0 freq 2.422G # iwconfig eth0 channel 3 # iwconfig eth0 channel auto www.2cto.com ap: connect to the specified AP or wireless network, the following parameters can be the MAC address of the AP or the identifier of the iwlist scan. If it is Ad-hoc, it is connected to an existing Ad-hoc network. 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 adapter supports multiple rates, you can use this command to set the working rate. A parameter smaller than 1000 is defined by a specific wireless NIC driver. It is generally an index value of the transmission rate. If it is greater than 1000, It is a rate, 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 a rate of less than 5.5M txpower: If the wireless network adapter supports multiple transmit power settings, this parameter is used to set the emission unit to dBm. If W is specified, only the conversion formula is: 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 receiving sensitivity, under this lower limit, the wireless network card thinks that the wireless network signal is too bad. Different network cards will take different measures, and some modern wireless network cards 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 of www.2cto.com: # 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 Part 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 www.2cto.com key/enc [ryption]: sets the encryption key used by the wireless network adapter. Here, it sets the encryption key in WEP mode, if you want to use WPA, you need the wpa_supplicant toolkit. 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 in 10 hexadecimal numbers or 5 ASCII characters, or bits, expressed in 26 hexadecimal numbers or 13 ASCII values. Example: # iwconfig eth0 key 0123-4567-89 # iwconfig eth0 key [3] 0123-4567-89 # iwconfig eth0 key s: password [2] # iwconfig eth0 key [2] www.2cto.com # 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 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. To facilitate configuration, you can write the configuration to/etc/network/interfaces, so that you do not need to configure it repeatedly in the future. Auto loiface lo inet loopback auto eth1iface eth1 inet staticaddress 192.168.1.3netmask 255.255.255.0gateway 192.168.1.1echo 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 staticaddress 255.255.255.0 auto dsl-provideriface dsl-provider inet ppppre-up/sbin/ifconfig eth0 up # line maintained by your dsl-provider then auto scaling eth0 inmanuet al

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.