Ubuntu 18.04修改IP地址
root@ubuntu:~# vim /etc/netplan/50-cloud-init.yaml
network:
ethernets:
enp0s31f6:
addresses:
- 10.0.0.3/24
gateway4: 10.0.0.1
nameservers:
addresses:
- 222.88.88.88
search: []
optional: true
version: 2
执行命令 使配置生效
root@ubuntu:~# netplan apply