ubuntu的新版本等已使用这种方式设置ip,具体操作如下

$sudo vim /etc/netplan/00-installer-config.yaml #任意配置名

修改完成后

sudo netplan apply