ubuntu 18.04.3 server 配置IP

采用修改这个文件/etc/network/interfaces ,改ip的方式在ubuntu 18里行不通:

临时配置IP方法如下:
sudo ip addr add 192.168.87.145/24 dev enp125s0f0

ip link set dev enp125s0f0 up; ip link set dev enp125s0f0 down
To verify the IP address configuration of enp125s0f0, you can use the ip command in the following manner.
ip address show dev enp125s0f0

上面的方面是临时生效,要想让这个配置长期生效,需要修改如下的配置文件:

infokist-arm:~$ cat /etc/netplan/99_config.yaml 
network:
  version: 2
  renderer: networkd
  ethernets:
    enp125s0f0:
      addresses:
        - 192.168.87.145/24
      gateway4: 192.168.87.1
      nameservers:
        search: [mydomain, otherdomain]
        addresses: [192.168.88.10,223.5.5.5]
    enp130s0f0:
      addresses:
        - 10.168.85.145/24
scutech@infokist-arm:~$ 

注意这个配置文件的缩进格式。

The configuration can then be applied using the netplan command.
sudo netplan apply

姚远ACE CSDN认证博客专家 ACE 华为云 MVP
Oracle ACE,华为云 MVP,Oracle10g,12c OCM; MySQL 5.6,5.7,8.0 OCP;CCNA; EMC Certified; IBM P Certified; RHCE; SQLServer 764; DB2 Certified; TOEIC 890;获得过两次国家部级科技进步奖;发明过两项计算机专利。微信:yaoyuanace 邮箱:yaoyuanace(at)qq.com
已标记关键词 清除标记
相关推荐
©️2020 CSDN 皮肤主题: Age of Ai 设计师:meimeiellie 返回首页