狐狸梦见乌鸦

当坚持成为一种习惯,目标将不在遥远```
  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

ubuntu network is unreachable解决办法

Posted on 2013-12-09 20:38  灬啊U  阅读(5684)  评论(0编辑  收藏  举报

版本:ubuntu10.04 之前使用的是动态分配IP,网络突然就不行了,改为静态分配IP。

配置静态IP地址
sudo vi /etc/network/interfaces

内容如下:
auto lo
iface lo inet loopback

auto eth1
#iface eth1 inet dhcp  动态分配
iface eth1 inet static
address 192.168.1.8 
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.1

配置DNS
vi /etc/resolv.conf
增加内容:
nameserver 192.168.1.1
naserver 202.106.0.20

配置网关
route add default gw 192.168.1.1

重新启动网络配置
/etc/init.d/networking restart  重启配置