发布于 2016-12-02 21:08:43 | 230 次阅读 | 评论: 0 | 来源: 网友投递

这里有新鲜出炉的精品教程,程序狗速度看过来!

Ubuntu Linux操作系统

Ubuntu(乌班图)是一个以桌面应用为主的Linux操作系统。Ubuntu基于Debian发行版和GNOME桌面环境,与Debian的不同在于它每6个月会发布一个新版本。


这篇文章主要介绍了ubuntu 静态IP的设定实现方法的相关资料,需要的朋友可以参考下

Ubuntu 设定静态IP:

切换到root用户,然后进入/etc/network目录。备份interfaces文件(备份文件是一个好习惯)

下面编辑interfaces文件,添加如下语句:


1 # Assgin static IP by eric on 26-SEP-2012
2 iface eth0 inet static
3 address 192.168.196.135     #change to your static IP
4 netmask 255.255.255.0      #change to your netmask
5 gateway 192.168.196.255     #change to your getway
6 #We must specify dns-nameserver here
7 #in order to get internet access from host
8 dns-nameservers 192.168.196.255
9 auto eth0

编辑完成后的interfaces文件内容如下:


root@ubuntu:/etc/network# cat interfaces
# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback

#add by andy at 2014-08-14
# Assgin static IP by eric on 26-SEP-2012
iface eth0 inet static
address 192.168.196.135     #change to your static IP
netmask 255.255.255.0      #change to your netmask
gateway 192.168.196.255     #change to your getway
#We must specify dns-nameserver here
#in order to get internet access from host
dns-nameservers 192.168.196.255
auto eth0

下一步就是重启网卡:


root@ubuntu:/etc/network# /etc/init.d/networking restart
重启完成后,测试一下:

 root@ubuntu:/etc/network# ping www.baidu.com.cn
 PING www.a.shifen.com (220.181.112.244) 56(84) bytes of data.
 64 bytes from 220.181.112.244: icmp_req=1 ttl=128 time=6.12 ms
 64 bytes from 220.181.112.244: icmp_req=2 ttl=128 time=14.7 ms

OK。静态IP设置完成。

感谢阅读,希望能帮助到大家,谢谢大家对本站的支持!



最新网友评论  共有(0)条评论 发布评论 返回顶部

Copyright © 2007-2017 PHPERZ.COM All Rights Reserved   冀ICP备14009818号  版权声明  广告服务