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

Ubuntu Server配置网络和查看IP地址

时间:2015-05-05 10:32:05      阅读:443      评论:0      收藏:0      [点我收藏+]

标签:

文章来源地址:http://my.oschina.net/junn/blog/142983

Ubuntu Server的网络参数保存在文件 /etc/network/interfaces中,默认设置使用dhcp,内容如下: 
# The primary network interface 
auto eth0 
iface eth0 inet dhcp 
设置静态ip的方法如下: 
1)编辑vi /etc/network/interfaces   
1.1)将dhcp 一行屏蔽 
# The primary network interface 
auto eth0 
#iface eth0 inet dhcp 
1.2)添加和静态ip有关的参数 
# The primary network interface 
iface eth0 inet static 
address 192.168.0.10 
netmask 255.255.255.0 
gateway 192.168.0.1 
2)编辑vi /etc/resolv.conf,设置dns 
nameserver 202.96.134.133 
nameserver 202.106.0.20 
3)执行下面两个命令,启用新设置 
$sudo ifdown eth0 
$sudo ifup eth0 
重启下网络服务 

sudo /etc/init.d/networking restart

Ubuntu Server配置网络和查看IP地址

标签:

原文地址:http://www.cnblogs.com/dymg/p/4478251.html

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