cd /etc/netplan
直接编辑
sudo vi /etc/netplan/00-installer-config.yaml
#network:
# ethernets:
# ens160:
# dhcp4: true
# version: 2network:version: 2ethernets:ens160:dhcp4: noaddresses: [172.17.10.23/24]optional: truegateway4: 172.17.10.1nameservers:addresses: [172.17.10.1]
最后执行
sudo netplan apply