Ubuntu新版静态IP设置

 

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 

 

posted @ 2023-07-13 16:29  韦邦杠  阅读(11)  评论(0编辑  收藏  举报