- 备份interface
sudo cp /etc/network/interface /etc/network/interface_bak
sudo rm /etc/network/interface
- 创建新的interface
sudo vim /etc/network/interface
写入:
auto lo
iface lo inet loopback
auto eth0
allow-hotplug eth0
iface eth0 inet dhcp
allow-hotplug wlan0
iface wlan0 inet manual
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet dhcp
- 创建wpa_supplicant.conf
sudo vim /etc/wpa_supplicant/wpa_supplicant.conf
写入:
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
ssid="网络ID"
psk="密码"
}
- 重启
sudo reboot
- 等候1-2分钟加入网络