进入: /etc/netplan 找到 01-network-manager-all.yaml
命令:sudo vim 01-network-manager-all.yaml
修改:
# Let NetworkManager manage all devices on this system
network:
version: 2
# renderer: NetworkManager
ethernets:
ens33:
dhcp4: no
addresses: [192.168.109.126/24]
optional: true
gateway4: 192.168.109.2
nameservers:
addresses: [8.8.8.8,8.8.4.4]
注意。冒号后面有空格
命令:sudo netplan apply