美文网首页
Ubuntu16.04 配置IP地址

Ubuntu16.04 配置IP地址

作者: 搬砖_工程师 | 来源:发表于2017-10-30 00:28 被阅读20次

修改配置

登录系统后,编辑文件/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 eno1
iface eno1 inet dhcp

修改成如下内容:

# 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 eno1

iface eno1 inet static
address 192.168.0.100
netmask 255.255.255.0
gateway 192.168.0.254


重启网络

sudo /etc/init.d/networking restart

正常步骤结束(开始正文)

在用ifconfig查看ip地址发现地址并没有更改,然后利用ip addr命令查看ip地址发现存在主ip地址就是原来通过dhcp获取到的地址。
还有一个我们设置的静态地址。我就懵了,两个地址,通过测试两个IP地址都ping的通(不要问怎么知道,我不是用虚拟机装的的)。懵逼中。。。(还是去问了度娘,真的有这种情况发生)按照博主的方法试了一下,好了。[csdn](http://bbs.csdn.net/topics/392027607
执行一下命令刷新网卡地址,好了

ip addr flush dev eth0;
ifdown eth0; 
ifup eth0 

相关文章

  • Ubuntu16.04 配置IP地址

    修改配置 登录系统后,编辑文件/etc/network/interfaces。原始的内容如下: 修改成如下内容: ...

  • [Ubuntu16.04] - SSH连接树莓派

    1. 扫描IP地址 [Ubuntu16.04] - 扫描IP地址 2. 连接 SSH USING LINUX OR...

  • linux网络管理-2

    Linux网络配置 Linux配置IP地址 DHCP服务器:自动分配IP地址 Linux配置IP地址的方法ifco...

  • Linux配置静态ip

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

  • Linux网络管理

    Linux配置IP 4种方式1.ifconfig命令临时配置IP地址2.setup工具永久配置IP地址3.修改网络...

  • Ubuntu16.04设置静态IP

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

  • 第九课 linux网络相关配置文件

    centos系统的网络配置 一、修改IP地址1、ip配置文件 修改对应网卡的IP地址配置文件/etc/syscon...

  • linux网络相关配置文件

    centos系统的网络配置 一、修改IP地址 1、ip配置文件 修改对应网卡的IP地址配置文件/etc/sysco...

  • linux网络相关配置文件

    centos系统的网络配置 一、修改IP地址 1、ip配置文件 修改对应网卡的IP地址配置文件/etc/sysco...

  • Linux网络基础04

    Linux配置IP地址的方法 1.ifconfig命令临时配置IP地址 ifconfig命令:查看与配置网络状态命...

网友评论

      本文标题:Ubuntu16.04 配置IP地址

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