首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > C语言 >

小弟我的linux ping任何地址出现Destination Host Unreachable

2013-03-29 
我的linux ping任何地址出现Destination Host Unreachableping错误:[root@ocp sbin]# ping 8.8.8.8PING 8.

我的linux ping任何地址出现Destination Host Unreachable
ping错误:
[root@ocp sbin]# ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
From 192.168.119.128 icmp_seq=2 Destination Host Unreachable
From 192.168.119.128 icmp_seq=3 Destination Host Unreachable
From 192.168.119.128 icmp_seq=4 Destination Host Unreachable

--- 8.8.8.8 ping statistics ---
5 packets transmitted, 0 received, +3 errors, 100% packet loss, time 5688ms
, pipe 3

一直找不到什么原因,希望大神帮找下原因,我可以在下面贴上一些信息。
首先是ip

[root@ocp sbin]# ./ifconfig
eth0      Link encap:Ethernet  HWaddr 00:0C:29:7A:B0:F0  
          inet addr:192.168.119.128  Bcast:192.168.119.255  Mask:255.255.255.0
          inet6 addr: fe80::20c:29ff:fe7a:b0f0/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:134537 errors:0 dropped:0 overruns:0 frame:0
          TX packets:324 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:13468957 (12.8 MiB)  TX bytes:22044 (21.5 KiB)
          Interrupt:67 Base address:0x2024 

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:2091 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2091 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:3131059 (2.9 MiB)  TX bytes:3131059 (2.9 MiB)



防火墙:
[root@ocp sbin]# ./chkconfig --list iptables
iptables        0:关闭  1:关闭  2:关闭  3:关闭  4:关闭  5:关闭  6:关闭

路由:
[root@ocp sbin]# ./route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.119.0   0.0.0.0         255.255.255.0   U     0      0        0 eth0
169.254.0.0     0.0.0.0         255.255.0.0     U     0      0        0 eth0


0.0.0.0         192.168.119.1   0.0.0.0         UG    0      0        0 eth0
还有什么需要贴上
[解决办法]
把你的 /etc/sysconfig/network-scripts/ifcfg-eth0 改成下面这样
DEVICE=eth0
BOOTPROTO=dhcp
ONBOOT=yes
HWADDR=00:0C:29:7A:B0:F0

然后再运行
sudo ifdown eth0
sudo ifup eth0
试试

热点排行