分页: 1 / 1

linx下Ping不通192.168.1.1

发表于 : 2012-01-13 0:34
wohenghaoye
存在的故障现象:安装了一个linux系统。安装完后ping 不通网关。能ping通自己(127.0.0.1);
在之前这个机子安装windows时候能用,可以PING通所有机子,和网关。
[root@localhost ~]# ping 192.168.1.1
PING 192.168.1.1 (192.168.1.1) 56(84) bytes of data.
From 192.168.1.1 icmp_seq=1 Destination Host Unreachable
...

--- 192.168.1.1 ping statistics ---
5 packets transmitted, 0 received, +3 errors, 100% packet loss, time 4002ms
, pipe 4

我输入netstat -nr

destination gateway genmask flags mss window irtt iface
192.168.1.0 0.0.0.0 255.255.255.0 u 0 0 0 eth0
169.254.0.0 ....... 255.255.0.0 ........................
0.0.0.0 192.168.1.1 0.0.0.0 ug ......................

traceroute 192.168.1.1
traceroute to 192.168.1.1 (192.168.1.1), 30 hops max, 46 byte packets

1 192.168.1.151 (192.168.1.151) 3001.101 ms !hicmp checksum is wrong icmp
checksun is wrong 3001.012 ms ! H 3001.034 ms !
原因:在linux中尚未设置dns所致。解决办法,把DNS设置成192.168.1.1(如果你的网关是这个
地址的话)即可。
PS:这是网上的贴子(http://www.028nz.com/?p=34),但是他没有说在哪里改DNS啊????????????????????????????

Re: linx下Ping不通192.168.1.1

发表于 : 2012-01-13 0:41
32idea
设置Ubuntu DNS
修改/etc/resolv.conf,在其中加入
nameserver DNS的地址1
nameserver DNS的地址2
完成。

用命令临时设定网络配置
1. 设置IP sudo ifconfig eth0 192.168.100.1 netmask 255.255.255.0 这样就算设置好了网卡eth0的IP地址和子网掩码
2. 设置网关 sudo route add default gw 192.168.1.1

Re: linx下Ping不通192.168.1.1

发表于 : 2012-01-13 20:27
onlylove
网关和DNS有半毛钱关系啊?如果你处在一个内网,没有dns服务器,你不用网络了?看不明白呢……