输入以下命令:
sudo vim /etc/netplan/50-cloud-init.yaml
配置如下
network:
ethernets:
eth0:
dhcp4: true
optional: true
wifis:
wlan0:
dhcp4: false
addresses: [192.168.1.101/24]
gateway4: 192.168.1.1
nameservers:
addresses: [192.168.1.1]
optional: true
access-points:
"xxxxx":
password: "xxxxx"