cd /etc/netplan
直接编辑
sudo vi /etc/netplan/00-installer-config.yaml
#network: # ethernets: # ens160: # dhcp4: true # version: 2 network: version: 2 ethernets: ens160: dhcp4: no addresses: [172.17.10.23/24] optional: true gateway4: 172.17.10.1 nameservers: addresses: [172.17.10.1]
最后执行
sudo netplan apply
标签:sudo,addresses,IP,netplan,version,172.17,Ubuntu,新版,network From: https://www.cnblogs.com/weibanggang/p/17551288.html