码迷,mamicode.com
首页 > 系统相关 > 详细

Ubuntu 14.04 静态IP设置

时间:2015-08-31 23:28:34      阅读:250      评论:0      收藏:0      [点我收藏+]

标签:

1. 编辑/etc/network/interfaces

vim /etc/network/interfaces

2.将以下五项添加到/etc/network/interfaces中

  • Static declaration (using <interface> chosen above): iface <interface> inet static
  • Static IP address: address <chosen ip>
  • Network gateway: gateway <gateway ip>
  • Netmask / subnet: netmask <netmask ip>
  • DNS nameservers: dns-nameservers <dns ip’s>

3. 修改后文件如下

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

# The loopback network interface
auto lo
iface lo inet loopback

auto eth0

# The primary network interface
iface eth0 inet static
address 192.168.1.8
gateway 192.168.1.1
netmask 255.255.255.0
dns-nameservers 223.5.5.5 223.6.6.6

4. 重启网络服务

service networking restart

Ubuntu 14.04 静态IP设置

标签:

原文地址:http://www.cnblogs.com/haseo/p/4774268.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!