一,连接无加密无线网络zhang:
sudo ip link set wlan0 up
sudo iw dev wlan0 connect zhang
sudo dhclient wlan0
二,连接WPA/WPA2加密无线网络zhang
输入命令wpa_passphrase zhang 产生如下配置文件,zhang是无线网ssid,回车后输入密码12345678:
$ wpa_passphrase zhang
# reading passphrase from stdin
12345678
network={ ssid="zhang" #psk="12345678" psk=ffecda21c80fbd09e188f4b0733b0be26286204fc77c8ebbbaf40a1518f4fb12 }