wpa_passphrase <yourAPssid> <yourpassphrase> > /etc/wpa_supplicant/wpa_supplicant.conf
For WPA2-Personalhtml
ctrl_interface=/var/run/wpa_supplicant ctrl_interface_group=0 ap_scan=1 network={ ssid="my_network" proto=RSN key_mgmt=WPA-PSK pairwise=CCMP TKIP group=CCMP TKIP psk="secret_password" }
network={ ssid="Mywireless" #請很是注意你ssid名的大小寫。 proto=RSN #Robust Security Network:強健安全網絡,表示這個網絡配置比WEP模式要更安全。 key_mgmt=WPA-PSK #請不管你是使用WPA-PSK,WPA2-PSK,都請在這裏輸入 WPA-PSK。這在wpa_supplicant看來WPA-PSK,WPA2-PSK都是 WPA-PSK pairwise=CCMP TKIP #關鍵點,wpa_supplicant目前還不認AES的加密標準 group=CCMP TKIP #同上 psk=7b271c9a7c8a6ac07d12403a1f0792d7d92b5957ff8dfd56481ced43ec6a6515 #wpa_supplicant算出來的加密密碼。
wpa_supplicant -B -i wlan0 -c /etc/wpa_supplicant/wpa_supplicant.conf dhclient wlan0
allow-hotplug wlan0 iface wlan0 inet static address 192.168.1.101 netmask 255.255.255.0 gateway 192.168.1.1 pre-up wpa_supplicant -B -i wlan0 -c /etc/wpa_supplicant/wpa_supplicant.conf