zoukankan      html  css  js  c++  java
  • Ubuntu 18.04 IP 设置

    配置文件

    vi /etc/network/interfaces
    

    自动IP

    # interfaces(5) file used by ifup(8) and ifdown(8)
    auto lo
    iface lo inet loopback
    
    auto ens33
    iface ens33 inet dhcp
    

    静态IP

    # interfaces(5) file used by ifup(8) and ifdown(8)
    auto lo
    iface lo inet loopback
    
    auto ens33
    iface ens33 inet static
    address 192.168.1.66
    netmask 255.255.255.0
    gateway 192.168.1.1
    

    注意:静态IP需要设置DNS否则不能联网。

    填写配置文件/etc/systemd/resolved.conf中的DNS值。

    # See resolved.conf(5) for details
    
    [Resolve]
    #DNS=
    DNS=8.8.8.8 223.5.5.5
    #FallbackDNS=
    #Domains=
    

    重启网络

    /etc/init.d/networking restart ifconfig
    
  • 相关阅读:
    单元测试
    软件测试计划
    软件杯A9的设计与实现
    阅读笔记7
    阅读笔记6
    阅读笔记5
    阅读笔记4
    阅读笔记3
    阅读笔记2
    阅读笔记1
  • 原文地址:https://www.cnblogs.com/llil/p/14541022.html
Copyright © 2011-2022 走看看