对于Ubuntu1804版本,经过测试如下配置可以设置静态IP地址:
Google@ubuntu:~$ cat /etc/netplan/01-netcfg.yaml
network:
ethernets:
ens33:
addresses: [172.22.5.8/16]
gateway4: 172.22.0.1
nameservers:
addresses: [114.114.114.114, 8.8.8.8]
必须要按照分层设置才能生效。