【将秘钥信息写入 /etc/wpa_supplicant/wpa_supplicant.conf】
sudo vim /etc/wpa_supplicant/wpa_supplicant.conf
network={
ssid="wifi_name"
}
【设置 /etc/network/interfaces文件】
sudo vim /etc/network/interfaces
# interfaces(5) file used by ifup(8) and ifdown(8)
# Include files from /etc/network/interfaces.d:
# source /etc/network/interfaces.d/* #注释掉这句话,避免引入/etc/network/interfaces.d/里面的eth0文件
#use wpa_supplicant command to connect wifi after ifup, the config info is in wpa_supplicant.conf
post-up wpa_supplicant -B -iwlan0 -c /etc/wpa_supplicant/wpa_supplicant.conf -Dnl80211,wext
【验证连接OK】
ip a
使用SecureCRT 连接192.168.1.9, 并通过ping
验证连接wifi成功
#手动连接wifi
sudo ip link set wlan0 down
sudo ip link set wlan0 up
sudo wpa_supplicant -B -iwlan0 -c /etc/wpa_supplicant/wpa_supplicant.conf -Dnl80211,wext
【将秘钥信息写入 /etc/wpa_supplicant/wpa_supplicant.conf】
sudo vim /etc/wpa_supplicant/wpa_supplicant.conf
network={
ssid="wifi_name"
}
【设置 /etc/network/interfaces文件】
sudo vim /etc/network/interfaces
# interfaces(5) file used by ifup(8) and ifdown(8)
# Include files from /etc/network/interfaces.d:
# source /etc/network/interfaces.d/* #注释掉这句话,避免引入/etc/network/interfaces.d/里面的eth0文件
#use wpa_supplicant command to connect wifi after ifup, the config info is in wpa_supplicant.conf
post-up wpa_supplicant -B -iwlan0 -c /etc/wpa_supplicant/wpa_supplicant.conf -Dnl80211,wext
【验证连接OK】
ip a
使用SecureCRT 连接192.168.1.9, 并通过ping
验证连接wifi成功
#手动连接wifi
sudo ip link set wlan0 down
sudo ip link set wlan0 up
sudo wpa_supplicant -B -iwlan0 -c /etc/wpa_supplicant/wpa_supplicant.conf -Dnl80211,wext