zoukankan      html  css  js  c++  java
  • Ubuntu18.04修改IP地址

    一、查看并修改IP地址

    Ubuntu 18.04使用netplan配置网络,其配置文件是yaml格式的。安装好Ubuntu 18.04之后,在/etc/netplan/目录下默认的配置文件名是00-installer-config.yaml,我们通过VIM修改它:

    # ifconfig 
    ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
            inet 192.168.56.11  netmask 255.255.255.0  broadcast 192.168.56.255
            inet6 fe80::20c:29ff:feee:97bf  prefixlen 64  scopeid 0x20<link>
            ether 00:0c:29:ee:97:bf  txqueuelen 1000  (Ethernet)
            RX packets 5431  bytes 465128 (465.1 KB)
            RX errors 0  dropped 0  overruns 0  frame 0
            TX packets 3321  bytes 411063 (411.0 KB)
            TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
    
    # cat /etc/netplan/00-installer-config.yaml 
    # This is the network config written by 'subiquity'
    network:
      ethernets:
        ens33:
          dhcp4: no
          addresses: [192.168.56.11/24]
          gateway4: 192.168.56.2
          nameservers:
            addresses: [114.114.114.114]    # dns地址
      version: 2
    
    
    # netplan apply   # 使配置文件生效
  • 相关阅读:
    bzoj 维护序列seq(双标记线段树)
    kmp算法总结
    2013蓝桥杯
    Longge的问题(欧拉,思维)
    mode(思维,注意内存)
    Jam's math problem(思维)
    77
    999
    888
    无 PowerShell.exe 执行 Empire 的几种姿势
  • 原文地址:https://www.cnblogs.com/cyleon/p/15366372.html
Copyright © 2011-2022 走看看