免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2274 | 回复: 3
打印 上一主题 下一主题

ping不通网关 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2008-11-09 14:32 |只看该作者 |倒序浏览
内网的一台机器,想做mail服务器,虚上公网的ip后,怎么也ping不通该ip的网关,可以ping通自己,配置如下,请大家指点:

[root@mx21 network-scripts]# more ifcfg-eth0
# Silicon Integrated Systems [SiS] SiS900 PCI Fast Ethernet
DEVICE=eth0
BOOTPROTO=static
HWADDR=00:0d:87:9f:0f:44
ONBOOT=yes
NETMASK=255.255.255.0
IPADDR=192.168.0.174
GATEWAY=192.168.0.1
TYPE=Ethernet

[root@mx21 network-scripts]# more ifcfg-eth0:1
# Silicon Integrated Systems [SiS] SiS900 PCI Fast Ethernet
DEVICE=eth0:1
BOOTPROTO=static
HWADDR=00:0d:87:9f:0f:44
ONBOOT=yes
NETMASK=255.255.255.224
IPADDR=218.249.218.201
#GATEWAY=218.249.218.193
TYPE=Ethernet

[root@mx21 network-scripts]# more /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=pcoffline.cn
#GATEWAY=218.249.218.193
[root@mx21 network-scripts]#

[root@mx21 network-scripts]# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
218.249.218.192 0.0.0.0         255.255.255.224 U     0      0        0 eth0
192.168.0.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.0.1     0.0.0.0         UG    0      0        0 eth0

论坛徽章:
0
2 [报告]
发表于 2008-11-09 14:39 |只看该作者

回复 #1 jiangbao1980 的帖子

[root@mx21 network-scripts]# ping www.sina.com
PING jupiter.sina.com.cn (202.108.33.32) 56(84) bytes of data.
64 bytes from 202.108.33.32: icmp_seq=1 ttl=242 time=46.8 ms
ping 公网都是通的,但加上218.249.218.193这个默认路由后,公网都不通了。

论坛徽章:
0
3 [报告]
发表于 2008-11-09 16:32 |只看该作者
路由问题,你添加了行的路由后将原内网的路由给覆盖掉了

论坛徽章:
0
4 [报告]
发表于 2008-11-09 16:36 |只看该作者

回复 #3 finddream 的帖子

[root@mx11 ~]# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
218.249.218.192 0.0.0.0         255.255.255.224 U     0      0        0 eth0
192.168.0.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.0.1     0.0.0.0         UG    0      0        0 eth0
[root@mx11 ~]#
[root@mx11 ~]#
[root@mx11 ~]# ping www.sina.com
PING jupiter.sina.com.cn (202.108.33.32) 56(84) bytes of data.
64 bytes from 202.108.33.32: icmp_seq=1 ttl=242 time=46.6 ms
64 bytes from 202.108.33.32: icmp_seq=2 ttl=242 time=46.5 ms

--- jupiter.sina.com.cn ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1000ms
rtt min/avg/max/mdev = 46.528/46.590/46.652/0.062 ms
[root@mx11 ~]# ping 218.249.218.193
PING 218.249.218.193 (218.249.218.193) 56(84) bytes of data.

--- 218.249.218.193 ping statistics ---
2 packets transmitted, 0 received, 100% packet loss, time 1000ms

[root@mx11 ~]# more /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=mx21.yeeyoo.cn
GATEWAY=218.249.218.193
[root@mx11 ~]#
现在ping公网都是通的,只是ping这个网关不通啊,什么问题呢?
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP