Ubuntu 18.04 LTS IP 地址设置

Posted 酱油

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Ubuntu 18.04 LTS IP 地址设置相关的知识,希望对你有一定的参考价值。

和之前的版本不太一样, Ubuntu 18.04 的 ip地址设置是用netplan管理的

 
 
配置文件在:
/etc/netplan/50-cloud-init.yaml

 

示例文件如下:

# This file is generated from information provided by
# the datasource.  Changes to it will not persist across an instance.
# To disable cloud-init‘s network configuration capabilities, write a file
# /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following:
# network: {config: disabled}
network:
    ethernets:
        ens33:
            addresses: [192.168.123.205/24]
            gateway4: 192.168.123.1
            dhcp4: no
            nameservers:
                    addresses: [223.5.5.5,223.6.6.6]
    version: 2

  

 

以上是关于Ubuntu 18.04 LTS IP 地址设置的主要内容,如果未能解决你的问题,请参考以下文章

ubuntu18.04LTS设置静态IP

Ubuntu 18.04添加新网卡

乌班图的世界——ubuntu18.04设置静态ip阶段总结

Ubuntu18.04 设置ip地址

树莓派安装Ubuntu设置静态IP

Ubuntu18.04如何设置固定ip