1. first of all, show me your wireless network:
>> iwlist scan
wlan0 Scan completed :
Cell 01 - Address: 14:CF:92:91:F1:2E
ESSID:"my12345"
Protocol:IEEE 802.11bgn
Mode:Master
Frequency:2.437 GHz (Channel 6)
Encryption key:on
Bit Rates:150 Mb/s
Extra:wpa_ie=dd160050f20101000050f20401000050f20401000050f202
IE: WPA Version 1
Group Cipher : CCMP
Pairwise Ciphers (1) : CCMP
Authentication Suites (1) : PSK
Extra:rsn_ie=30140100000fac040100000fac040100000fac020000
IE: IEEE 802.11i/WPA2 Version 1
Group Cipher : CCMP
Pairwise Ciphers (1) : CCMP
Authentication Suites (1) : PSK
Quality=100/100 Signal level=100/100
2. then, configure your conf file of wpa_suppliant
>> cat /etc/wpa_suppliant/wpa_suppliant.conf
ctrl_interface=/var/run/wpa_supplicant
ctrl_interface_group=wheel
network={
ssid="my12345"
proto=WPA2
key_mgmt=WPA-PSK
pairwise=CCMP
group=CCMP
psk=c0d128a54dc2b0d29cc058204088440efd2fa168a2d96594f5736f9f3b34f6a9
}
//NOTE: psk is created by:
// wpawpa_passphrase my12345 my_password.
3. check this file:
cat /etc/sysconfig/wpa_supplicant
# Use the flag "-i" before each of your interfaces, like so:
# INTERFACES="-i eth1 -i wlan0"
INTERFACES="-i wlan0"
# Use the flag "-D" before each driver, like so:
# DRIVERS="-D wext"
DRIVERS="-D wext"
# Other arguments
# -u Enable the D-Bus interface (required for use with NetworkManager)
# -f Log to /var/log/wpa_supplicant.log
OTHER_ARGS="-u -f /var/log/wpa_supplicant.log"
4. things are ready, use:
>>service wpa_suppliant start
5. get the ip address
>> dhclient
参考资料:
1.
Redhat 5 下 Linux 无线网卡连接 WIFI WPA-PSK密码,
http://hi.baidu.com/velercy/item/e6b320248f0b581608750883
2.