美文网首页
Ubuntu16.04下设置静态IP

Ubuntu16.04下设置静态IP

作者: Skye_kh | 来源:发表于2017-05-10 14:21 被阅读185次

vi /etc/network/interfaces

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto ens160    #设置自动启动ens160接口
#iface ens160 inet dhcp  

iface ens160 inet static   #配置静态IP
address 10.1.18.200  #IP地址
netmask 255.255.255.0  #子网掩码
gateway 10.1.18.254    #默认网关
dns-nameserver 210.32.32.10

dns-nameserver 210.32.32.10 这句一定需要有,
因为以前是DHCP解析,所以会自动分配DNS 服务器地址。
而一旦设置为静态IP后就没有自动获取到DNS服务器了

设置完重启电脑

/etc/resolv.conf 文件中会自动添加

nameserver 210.32.32.10

(或者nameserver 8.8.8.8)可以根据访问速度,选择合适的公共DNS

相关文章

  • Ubuntu16.04动态静态ip设置

    Ubuntu16.04 动态静态ip设置 1. 动态ip设置(eth0是网卡名称) 2. 静态ip设置(eth0是...

  • Linux配置静态ip

    ubuntu16.04配置静态ip: 配置 手动设置dns /etc/resolv.conf 和 /etc/res...

  • Ubuntu16.04下设置静态IP

    vi /etc/network/interfaces dns-nameserver 210.32.32.10 这句...

  • Ubuntu16.04设置静态IP

    本文介绍Ubuntu16.04环境下,静态IP的配置流程。 (1)获取网卡名字 ip route show (2)...

  • Ubuntu16.04设置静态IP

    装了ubuntu后,需要其他电脑进行局域网登陆,访问共享目录等,就需要IP不要自动获取,而是静态固定IP 方法如下...

  • ubuntu16.04设置静态ip

    在/etc/network/interfaces.d/目录下创建eth0,eth1文件 内容分别为 auto et...

  • Ubuntu16.04下设置静态IP(Nat网络设置)

    想在自己的本子上配置Hadoop伪分布式,最首要的就是要给系统配置一个静态ip;一开始,我安装网上的步骤进行静态i...

  • ubuntu16.04设置静态ip地址

    1.cd /etc/netword 进入目录,修改interfaces文件 2.修改interfaces文件,配置...

  • 树莓派

    树莓派设置静态ip 编辑文件,找到设置静态ip的地方,一般情况下都是注释掉的,可以手动解开,修改成下面的设置。如果...

  • CentOS 7 主机名访问

    1、设置静态IP CentOS 7 设置静态ip 2、设置主机名 echo "centos-100" > /etc...

网友评论

      本文标题:Ubuntu16.04下设置静态IP

      本文链接:https://www.haomeiwen.com/subject/aaqgtxtx.html