和之前的版本不太一样, 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 netw…
临时添加 IP 地址 首先,让我们找到网卡的 IP 地址.在我的 Ubuntu 15.10 服务器版中,我只使用了一个网卡. 运行下面的命令找到 IP 地址: 复制代码 代码如下: sudo ip addr 样例输出: 复制代码 代码如下: 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default link/loopback 00:00:00:00:00:00 brd 00:00:00:0…
前言 连接远程server重启的时候发现IP发生变化,影响远程连接,此时,需要将server配置为静态IP. 系统环境 ubuntu16.04 操作过程 1. 设置IP和DNS command sudo vi /etc/networks/interfaces 添加蓝色部分内容 #The loopback network interface auto lo iface lo inet loopback # The primary network interface auto ens0_name /…
在Ubuntu 18中使用 netplan 命令 首先 cd /etc/netplan/ 找到 *.yaml文件(每个人可能不一样),编辑它 root@waydeserver:/etc/netplan# -cloud-init.yaml 按如下格式修改内容: # This file is generated from information provided by # the datasource. Changes to it will not persist across an instanc…