您的位置:首页 > 其它

ubuntu设置静态ip

2015-10-25 09:36 381 查看
1. modify /etc/networks/interfaces as follow.

****************************************************************************************

auto lo

iface lo inet loopback

#net card eth0 configuration

auto eth0

iface eth0 inet static

#set static ip

address 192.168.1.108

netmask 255.255.255.0

gateway 192.168.1.1

#dns-nameservers 8.8.8.8

#network 192.168.1.0

#boardcast 192.168.1.255

****************************************************************************************

2. modify /etc/resolvconf/resolv.conf.d/head as follow.

****************************************************************************************

nameserver 202.96.128.86

****************************************************************************************

the below 3 lines was ok before:

search mydomain.com

nameserver 61.139.39.73

nameserver 61.139.2.69

3. sudo /etc/init.d/networking restart

4. modify /etc/resolv.conf as follow if it not changed after network restarted

****************************************************************************************

nameserver 202.96.128.86

****************************************************************************************

notice:

if Ubuntu can't connect to network, it may be nameserver is not proper, and try a new nameserver.

Ubuntu下设置static ip及DNS的博文链接:
http://www.jb51.net/os/Ubuntu/104873.html http://m.blog.csdn.net/blog/u011255705/24573299
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: