Iwconfig usage
1. Turn on the wireless card power
Iwconfig Wlan0 Txpower No
2. List the wireless networks in the area
Iwconfig wlan0 Scan
3. Assuming that you want to connect to a network myhome (that is, Essid is a myhome network), then enter the command
Iwconfig wlan0 Essid "MyHome"
If the network is encrypted and the password is 0123456789, enter the command
Iwconfig wlan0 Essid "MyHome" key 0123-4567-89
4 if normal, enter
Iwconfig Wlan0
You can see the parameters that are properly connected.
5. Start the wireless card
Ifconfig wlan0 up
6. If you are using DHCP to obtain IP, then use dhclient or DHCPCD to obtain the IP
Dhclient wlan0 or dhcpcd wlan0
7. Now the wireless card should be able to use the normal.
WPA supplicant
The WPA supplicant Toolkit allows you to connect to those APs that use WPA. Because it's just a beta version, the way it's configured is still constantly changing-even though it's already working well in most cases.
| code 2.1: Install wpa_supplicant |
emerge net-wireless/wpa_supplicant |
Important: to make wpa_supplicant work properly, you must open Config_packet support in the kernel. |
Now we need to configure /etc/conf.d/net File so that we can choose to use wpa_supplicant without wireless-tools (when both are installed in the system, the default is to use wireless-tools ).
| code 2.2: Configure Wpa_supplicant |
# use wpa_supplicant instead of wireless-toolsmodules= (" Wpa_supplicant ") # because Wpa_supplicant is not a good auto-detection driver, we need to specify the driver we are using. wpa_supplicant_eth0= "-dmadwifi" |
| note: If you are using HOST-AP driver, you must first set the wireless device card to in order to properly fit wpa_ supplicant work. You can set font-size:1em >/etc/conf.d/net in Font-family:monospace, ' Courier New '; Color: #00c8; Font-size:1em ">iwconfig_eth0=" mode managed " to achieve this. |
It looks simple, doesn't it? However, we also need to configure the wpa_supplicant itself, which will be more cumbersome, depending on the level of security of the AP you are connecting to. The following example is extracted from the /usr/share/doc/wpa_supplicant-<version>/wpa_supplicant.conf.gz and simplified, and this file is derived from the Wpa_ supplicant Package.
Code Listing 2.3: an example of a/etc/wpa_supplicant/wpa_supplicant.conf |
# Please do not modify the following line of content, otherwise it will not work ctrl_interface=/var/run/wpa_supplicant# ensure that only the root user can read the configuration of WPA ctrl_interface_group=0# use Wpa_ supplicant to scan and select apap_scan=1# simple case: Wpa-psk Password authentication method, PSK is an ASCII passphrase, all legitimate encryption methods allow connection network={ssid= "Easy" psk= "very Secret Passphrase "# The higher the priority, the sooner it can be matched. The priority=5}# is the same as the previous setting, but requires a scan of a specific SSID (for those APs that refuse to broadcast the SSID) network={ssid= "Second SSID" Scan_ssid=1 psk= "very secret Passphrase "priority=2}# only use WPA-PSK mode. Allows use of any combination of legal encryption network={ssid= "Example" PROTO=WPA key_mgmt=wpa-psk pairwise=ccmp tkip group=ccmp tkip WEP104 WEP40 PSK=06B4BE19DA289F475AA46A33CB793029D4AB3DB7A23EE92382EB0106C72AC7BB priority=2}# Clear text connection (without WPA and ieee802.1x) network={ssid= "plaintext-test" key_mgmt=none}# shared WEP key connection (not using WPA and IEEE802.1X) network={ Ssid= "Static-wep-test" Key_mgmt=none # quotes contain keys that are ASCII key wep_key0= "ABCDE" # no quotes contain keys that are hexadecimal keys wep_key1=0102030405 wep_k Ey2= "1234567890123" wep_tx_keyidx=0 priority=5}# shared WEP key connection mode (no WPA and ieee802.1x), using shared Key IEEE802.11 authentication method network={ssid= " Static-wep-test2 "key_mgmt=none wep_key0= "ABCDE" wep_key1=0102030405 wep_key2= "1234567890123" Wep_tx_keyidx=0 priority=5 Auth_alg=SHARED} # Use wpa-none/tkipnetwork={ssid= "Test Adhoc" mode=1 proto=wpa key_mgmt=wpa-none Pairwise=NONE Group=T in Ibss/ad-hoc network KIP psk= "Secret Passphrase"} |
WiFi graphics configuration software can be used:http://wifi-radar.berlios.de/
WiFi More detailed introduction can be consulted:http://www.gentoo.org/doc/zh_cn/handbook/handbook-x86.xml?part=4&chap=4
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
WiFi test Correlation (IWCONFIG,WPA supplicant usage)