ubuntu18设置静态ip

修改配置文件/etc/netplan/50-cloud-init.yaml
network:
version: 2
ethernets:
ens33:
dhcp4: no
dhcp6: no
addresses: [192.168.12.6/24]
optional: true
gateway4: 192.168.12.2
nameservers:
addresses: [223.5.5.5,223.6.6.6,8.8.8.8]

netplan apply

你可能感兴趣的:(ubuntu18设置静态ip)