LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 1175|回复: 7

帮我看看我的双网卡无法跨网段访问(ping都不通)?

[复制链接]
发表于 2003-6-21 08:57:51 | 显示全部楼层 |阅读模式
eth0: 192.168.1.89 gw 192.168.1.254 接外网
eth1: 192.168.2.254 接内网

客户机ip:192.168.2.200 gw 192.168.2.254
ping不通192.168.1.254 能ping通192.168.1.89
---------------------------------------------------------------------
Kernel IP routing table
Destination     Gateway     Genmask         Flags Metric Ref Use Iface
255.255.255.255 *           255.255.255.255 UH     0      0   0   eth1
192.168.2.0     *           255.255.255.0   U      0      0   0   eth1
192.168.1.0     *           255.255.255.0   U      0      0   0   eth0
127.0.0.0       *           255.0.0.0       U      0      0   0   lo
default       192.168.1.254 0.0.0.0         UG     0      0   0   eth0
---------------------------------------------------------------------
各位帮我看看啊。
发表于 2003-6-21 09:24:08 | 显示全部楼层
客户机有没有指定网关?
发表于 2003-6-21 10:55:00 | 显示全部楼层
try this
echo 1 >/proc/sys/net/ipv4/ip_forward
发表于 2003-6-21 10:56:37 | 显示全部楼层
or edit  /etc/sysctl.conf
check if this exists:
net.ipv4.ip_forward=1
 楼主| 发表于 2003-6-23 10:51:39 | 显示全部楼层
最初由 tower 发表
try this
echo 1 >/proc/sys/net/ipv4/ip_forward


不行啊。除非加上下面的命令:
echo 1 >/proc/sys/net/ipv4/ip_forward
iptables -t nat -A POSTROUTING -s 192.168.2.0/24 -j SNAT --to 192.168.1.89
即使这样也只能ping到192.168.1.0网段的ip,网上邻居使不了啊。
如何在网上邻居也能看到啊?
 楼主| 发表于 2003-6-23 10:53:07 | 显示全部楼层
最初由 tower 发表
or edit  /etc/sysctl.conf
check if this exists:
net.ipv4.ip_forward=1


不行啊,我的最终目的是网上邻居也能跨网段访问
发表于 2003-6-23 12:02:52 | 显示全部楼层
客户机ip:192.168.2.200 gw 192.168.2.254
eth0: 192.168.1.89 gw 192.168.1.254 接外网
eth1: 192.168.2.254 接内网
这应该是路由吧。你看看路由表信息是怎么样的。route命令
 楼主| 发表于 2003-6-26 09:12:03 | 显示全部楼层
[root@localhost root]# route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.2.0     *               255.255.255.0   U     0      0        0 eth1
192.168.1.0     *               255.255.255.0   U     0      0        0 eth0
127.0.0.0       *               255.0.0.0       U     0      0        0 lo
default         192.168.1.254   0.0.0.0         UG    0      0        0 eth0
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表