ubuntu 网络配置

原创
2015/12/15 09:41
阅读数 6

修改ip:

vi /etc/network/interfaces

auto eth0

iface eth0 inet static

address 192.168.1.120

netmask 255.255.255.0

gateway 192.168.1.1


修改dns:

vi /etc/resolvconf/resolv.conf.d/base (长期)

vi /etc/resolv.conf (临时)

nameserver 114.114.114.114



摘:http://blog.sina.com.cn/s/blog_67be3b450101de44.html

# The loopback network interface

auto lo

iface lo inet loopback

# The primary network interface

auto eth0

iface eth0 inet static

address xxx.xxx.xxx.xxx

netmask xxx.xxx.xxx.xxx

gateway xxx.xxx.xxx.xxx

auto eth0:0

iface eth0:0 inet static

address xxx.xxx.xxx.xxx

netmask xxx.xxx.xxx.xxx

#dns-nameservers 202.102.224.68 202.102.227.68

up route add -net xxx.xxx.xxx.xxx netmask xxx.xxx.xxx.xxx gw xxx.xxx.xxx.xxx eth0

up route add -net xxx.xxx.xxx.xxx netmask xxx.xxx.xxx.xxx gw xxx.xxx.xxx.xxx eth0

up route add -net xxx.xxx.xxx.xxx netmask xxx.xxx.xxx.xxx gw xxx.xxx.xxx.xxx eth0

展开阅读全文
打赏
0
0 收藏
分享

作者的其它热门文章

加载中
更多评论
打赏
0 评论
0 收藏
0
分享
返回顶部
顶部