ssid 名称为 MyCharterWiFi99-2G,安全选项:无,WPA2-PSK [AES],密码:happygiant682,我的操作系统是 debian8。
cat /etc/wpa_supplicant.conf
network={
ssid="MyCharterWiFi99-2G"
psk="happygiant682"
}
#wpa_supplicant -B -i wlan0 -c /etc/wpa_supplicant.conf
Successfully initialized wpa_supplicant
# iw wlan0 link
Not connected.
执行 wpa_supplicant 命令时没有错误信息,成功初始化 wpa_supplicant,为什么没有连接?
在调试模式下运行 wpa_supplicant 时出现一些错误信息。
wpa_supplicant -D nl80211 -i wlan0 -c /etc/wpa_supplicant.conf
Successfully initialized wpa_supplicant
wlan0: SME: Trying to authenticate with 04:a1:51:ba:6a:99 (SSID='MyCharterWiFi99-2G' freq=2417 MHz)
wlan0: Trying to associate with 04:a1:51:ba:6a:99 (SSID='MyCharterWiFi99-2G' freq=2417 MHz)
wlan0: Associated with 04:a1:51:ba:6a:99
wlan0: CTRL-EVENT-DISCONNECTED bssid=04:a1:51:ba:6a:99 reason=3 locally_generated=1
wlan0: SME: Trying to authenticate with 04:a1:51:ba:6a:99 (SSID='MyCharterWiFi99-2G' freq=2417 MHz)
wlan0: Trying to associate with 04:a1:51:ba:6a:99 (SSID='MyCharterWiFi99-2G' freq=2417 MHz)
wlan0: Associated with 04:a1:51:ba:6a:99
wlan0: CTRL-EVENT-DISCONNECTED bssid=04:a1:51:ba:6a:99 reason=3 locally_generated=1
wlan0: SME: Trying to authenticate with 04:a1:51:ba:6a:99 (SSID='MyCharterWiFi99-2G' freq=2417 MHz)
wlan0: Trying to associate with 04:a1:51:ba:6a:99 (SSID='MyCharterWiFi99-2G' freq=2417 MHz)
wlan0: Associated with 04:a1:51:ba:6a:99
wlan0: CTRL-EVENT-DISCONNECTED bssid=04:a1:51:ba:6a:99 reason=3 locally_generated=1
wlan0: SME: Trying to authenticate with 04:a1:51:ba:6a:99 (SSID='MyCharterWiFi99-2G' freq=2417 MHz)
wlan0: Trying to associate with 04:a1:51:ba:6a:99 (SSID='MyCharterWiFi99-2G' freq=2417 MHz)
wlan0: Associated with 04:a1:51:ba:6a:99
wlan0: CTRL-EVENT-DISCONNECTED bssid=04:a1:51:ba:6a:99 reason=3 locally_generated=1
wlan0: CTRL-EVENT-SSID-TEMP-DISABLED id=0 ssid="MyCharterWiFi99-2G" auth_failures=1 duration=10 reason=CONN_FAILED
答案1
使用 /etc/network/interfaces 的形式解决
auto lo
iface lo inet loopback
auto wlan0
iface wlan0 inet manual
wpa-driver nl80211
wpa-roam /etc/wpa_supplicant.conf
iface default inet dhcp
重启,立即上网。