使用 wpa_supplicant 配置无线网络
$ wpa_passphrase <your_ssid> <your_psk>
# your_ssid: 无线网络名称
# your_psk: 无线网络的密码
ctrl_interface=/var/run/wpa_supplicant
# ap_scan=2
network={
       ssid="your_ssid"
       scan_ssid=1
       proto=WPA RSN
       key_mgmt=WPA-PSK
       pairwise=CCMP TKIP
       group=CCMP TKIP
       psk=your_psk
}
# your_psk:第二步生成的psk
iface wlan0 inet static
address 192.168.0.125
netmask 255.255.255.0
wireless-ssid "essid"
gateway 192.168.0.1

pre-up wpa_supplicant -B -Dwext -iwlan0 -c/etc/wpa_supplicant.conf
post-down killall -q wpa_supplicant
sudo /etc/init.d/networking restart

参考资料