Ubuntu 18.04修改IP地址

注:配置/etc/network/interfaces已无用

root@ubuntu:~# vim /etc/netplan/50-cloud-init.yaml

 

network:
    ethernets:
        enp0s31f6:
                addresses:
                -  192.168.1.244/24
                gateway4: 192.168.1.1
                nameservers:
                    addresses:
                    - 223.5.5.5
                    search: []
                optional: true

    version: 2

 

执行命令 使配置生效

root@ubuntu:~# netplan apply
posted @ 2018-07-11 12:52  Oops!#  阅读(2962)  评论(0编辑  收藏  举报