1. 扫描可用网络

    iwlist wlan0 scan | grep ESSID

  2. 将密码写入配置文件

    wpa_passphrase WIFI-ESSID WIFI-PASSWORD > /etc/wpa_supplicant/wpa_supplicant.conf

  3. 建立连接

    wpa_supplicant -Dwext -iwlan0 -c /etc/wpa_supplicant/wpa_supplicant.conf -B

  4. 获取地址

    dhclient wlan0