# modprobe wl
Verify your device has an available interface:
使用下面的命令,查看网卡信息,比如网卡名称
# iwconfig
安装软件
wpa_supplicant
# apt-get install wpasupplicant
WPA-PSK and WPA2-PSK
Also known as "WPA Personal" and "WPA2 Personal" respectively.
Restrict the permissions of /etc/network/interfaces, to prevent pre-shared key (PSK) disclosure:
# chmod 0600 /etc/network/interfaces
Open /etc/network/interfaces in a text editor:
# vim /etc/network/interfaces
Define appropriate stanzas for your wireless interface, along with the SSID and PSK. For example:
auto wlan0 //这个位置注意,wlan0的名字应该替换为我自己iwconfig以后出现
iface wlan0 inet dhcp //的名字,我自己目前的就是eth1
wpa-ssid mynetworkname
wpa-psk mysecretpassphrase
The "auto" stanza will bring your interface up at system startup. If not desired, remove or comment this line.
Save the file and exit the editor.
Bring your interface up. This will start wpa_supplicant as a background process.
# ifup wlan0
Additional wpa-* options are described within /usr/share/doc/wpasupplicant/README.modes.gz. This should also be read if connecting to a network not broadcasting its SSID.