LinuxSir.cn,穿越时空的Linuxsir!

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

双网卡,静态路由 请教

[复制链接]
发表于 2007-5-13 10:57:31 | 显示全部楼层 |阅读模式
网络1:192.168.3.0/24
网络2:10.124.8.0/24

网络中间是一台 ARCH (PC1)双网卡,
eth0:192.168.3.100/24
eth1:10.124.8.1/24

PC1 route table:


[root@myhost ~]# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
10.124.8.0      0.0.0.0         255.255.255.0   U     0      0        0 eth1
192.168.3.0     0.0.0.0         255.255.255.0   U     0      0        0 eth0
0.0.0.0         192.168.3.200   0.0.0.0         UG    0      0        0 eth0
[root@myhost ~]#

网络2中一台主机(PC2)
PC2 route table:


[root@myhost ~]# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
10.124.8.0      0.0.0.0         255.255.255.0   U     0      0        0 eth0
0.0.0.0         10.124.8.1  0.0.0.0         UG    0      0        0 eth0
[root@myhost ~]#



我想用PC2 ping 到 192.168.3.200 ,不知道怎么才能实现?
发表于 2007-5-13 14:24:14 | 显示全部楼层
直接ping不行么?

打开 ip_forwarding 没?
回复 支持 反对

使用道具 举报

 楼主| 发表于 2007-5-13 20:26:19 | 显示全部楼层
开启了ip_forward但是 PC2 ping PC1的网关 192.168.3.200 ping不通,但是可以ping到192.168.3.2
回复 支持 反对

使用道具 举报

发表于 2007-5-13 20:55:13 | 显示全部楼层
在arch上

iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

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