Ubuntu网卡设置:配置/etc/netplan

对于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]

必须要按照分层设置才能生效。

posted @ 2019-03-05 20:51  abb_ceo  阅读(5853)  评论(0编辑  收藏  举报