1、查看網口
ip a
看到 eth0 lo wlan0等
2、進入 /etc/netplan/ ,復制備份內部現存的*.yaml文件,編輯原文件
network: version: 2 ethernets: eth0: optional: true dhcp4: true wifis: wlan0: optional: true dhcp4: true access-points: "無線網名稱": password: "無線密碼"
3、 執行 sudo netplan --debug try 測試配置
如果出錯,執行 sudo netplan --debug generate 查看更多信息
ping www.baidu.com //是可以ping 通的
如果沒出錯,執行 sudo netplan --debug apply 應用配置
ping www.baidu.com //是可以ping 通的
4. 如果沒問題,重啟應該就好了