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 Listing 2.1: Installing 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 the /etc/conf.d/net file so that we can choose to use wpa_supplicant instead of Wireless-tools (both are installed in the system, the default is to use Wireless-tools).
Code Listing 2.2: Configuring Wpa_supplicant in/etc/conf.d/net |
# use Wpa_supplicant instead of wireless-toolsmodules= ("Wpa_supplicant")# because Wpa_supplicant doesn't have a good auto-detect driver, so we need to specify the driver we're using. wpa_supplicant_eth0= "-dmadwifi" |
Note: If you are using the Host-ap driver, you first set the wireless device card to managed mode so that you can work properly with wpa_supplicant. You can do this by setting iwconfig_eth0= "mode managed" in/etc/conf.d/net. |
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.
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
WiFi test Correlation (IWCONFIG,WPA supplicant usage)