zoukankan      html  css  js  c++  java
  • ubuntu 18.04修改静态ip地址

    1. 确认网卡名称

    ip a  #有ens开头的网卡,比如我的是ens160
    

    2. DHCP的方式获取动态ip

    vim /etc/netplan/00-installer-config.yaml
    
    network:
      ethernets:
          ens160:
              dhcp4: yes
              addresses: []
    
      version: 2
    

    3. 设置静态ip

    vim /etc/netplan/00-installer-config.yaml
    network:
      ethernets:
          ens160:
              dhcp4: no
              addresses: [172.16.200.6/24]
              optional: true
              gateway4: 172.16.200.254
              nameservers:
                  addresses: [202.96.128.86,202.96.128.166]
    
    
      version: 2
    

    4. 应用新的网卡配置信息

    netplan apply
    

    5. 测试网络连通性

    ping www.baidu.com

    PING www.a.shifen.com (14.215.177.39) 56(84) bytes of data.
    64 bytes from 14.215.177.39 (14.215.177.39): icmp_seq=1 ttl=55 time=6.39 ms
    64 bytes from 14.215.177.39 (14.215.177.39): icmp_seq=2 ttl=55 time=6.53 ms
    64 bytes from 14.215.177.39 (14.215.177.39): icmp_seq=3 ttl=55 time=6.66 ms
    64 bytes from 14.215.177.39 (14.215.177.39): icmp_seq=4 ttl=55 time=6.41 ms
    64 bytes from 14.215.177.39 (14.215.177.39): icmp_seq=5 ttl=55 time=6.43 ms
    64 bytes from 14.215.177.39 (14.215.177.39): icmp_seq=6 ttl=55 time=6.52 ms
    64 bytes from 14.215.177.39 (14.215.177.39): icmp_seq=7 ttl=55 time=6.39 ms
    64 bytes from 14.215.177.39 (14.215.177.39): icmp_seq=8 ttl=55 time=6.56 ms
    64 bytes from 14.215.177.39 (14.215.177.39): icmp_seq=9 ttl=55 time=6.54 ms

  • 相关阅读:
    Zookeeper服务器启动
    BeanFactoryPostProcessor
    ZK简介
    自定义标签解析
    高性能MySQL
    Redis原理
    ApplicationContext
    ThreadPoolExecutor
    NW.js构建PC收银端安装程序的指南
    NW.js安装原生node模块node-printer控制打印机
  • 原文地址:https://www.cnblogs.com/Jack1023/p/14813606.html
Copyright © 2011-2022 走看看