|
|
楼主 |
发表于 2005-11-20 09:58:22
|
显示全部楼层
今天我又在做这个路由,怪的很,我现在用四台机:
1??2??3??4
Device Eth0 Eth1
PC1 192.168.10.2/24
Route1 192.168.10.1/24 192.168.20.1/24
Route2 192.168.20.2/24 192.168.30.1/24
PC2 192.168.30.2/24
1 4为两客户机??PC1 PC2,只有一张网卡。
2 3为两模拟的路由linux PC,有双网卡。
三个网段,同网段的网卡互连,这个我还是不会出错的。
两路由器都开启/proc/sys/net/ipv4/ip_forward,
开始时1 4号机还没开启,只是2??3互连,完全四张网卡ping通没问题,但当连上1号机后,1号机??linux redhat9 也装了双网卡,但一网卡没接网线,接上1号机后,2号机仍能与1号机ping通,2 3号机也能ping通,但1 3号机不通。我觉得我路由表也没设错,设的是静态路由,下附三台机子的路由表:
我在终端中敲route后:
1号机:
kernel ip routing table
destination gateway genmask flag metric ref use iface
192.168.50.0 X 255.255.255.0 U 0 0 0 eth1
192.168.10.0 X 255.255.255.0 U 0 0 0 eth0
192.168.20.0 X 255.255.255.0 U 0 0 0 eth0
127.0.0.0 X 255.0.0.0 U 0 0 0 lo
169.254.0.0 X 255.255.0.0 U 0 0 0 eth1
PS:在一开始1号机启动的时候,默认的eth1 ip是 192.168.30.1, eth0 192.168.20.2,当时2 3号机在线,但我开机后马上改过来了,变成上面所示了,这应该没太多问题吧。
2号机:
kernel ip routing table
destination gateway genmask flag metric ref use iface
192.168.20.0 X 255.255.255.0 U 0 0 0 eth1
192.168.30.0 X 255.255.255.0 U 0 0 0 eth1
192.168.10.0 X 255.255.255.0 U 0 0 0 eth0
127.0.0.0 X 255.0.0.0 U 0 0 0 lo
3号机:
kernel ip routing table
destination gateway genmask flag metric ref use iface
192.168.20.0 X 255.255.255.0 U 0 0 0 eth0
192.168.30.0 X 255.255.255.0 U 0 0 0 eth1
192.168.10.0 X 255.255.255.0 U 0 0 0 eth0
127.0.0.0 X 255.0.0.0 U 0 0 0 lo
望各位指点啊,十分感谢,为了这个我搞了两天了。还是不行。怪事啊。路由表也不觉有错啊。 |
|