- 论坛徽章:
- 0
|
原帖由 Godbach 于 2009-3-20 21:41 发表
那么在桥模式下,wan口和lan口应该没有IP。他们会根据交换机的方式转发报文吧。
不好意思,可能我没有说清楚。
我在这里把具体情况再说下吧,拓扑如下:
中间设备是router,route表如下:
- > route show
- Kernel IP routing table
- Destination Gateway Genmask Flags Metric Ref Use Iface
- 192.168.1.1 175.18.214.8 255.255.255.255 UGH 0 0 0 eth0
- 175.18.214.0 * 255.255.255.0 U 0 0 0 eth0
- 192.168.1.0 * 255.255.255.0 U 0 0 0 br0
- default 175.18.214.8 0.0.0.0 UG 0 0 0 eth0
复制代码
router中的bridge配置如下:
- > brctl show
- bridge name bridge id STP enabled interfaces
- br0 8000.00904cc004b1 no wl0
- eth1.2
- eth1.3
- eth1.4
- eth1.5
- eth0
复制代码
eth0是wan口,eth1.2, eth1.3, eth1.4, eth1.5是四个lan口。
这时我从lan侧pc上发起ping命令:
ping包首先会到达router的ip层,router的ip层发现目的ip是175.18.214.8,会route这个包。router会先去查找路由表,根据前面我贴出来的路由表信息,router会匹配到这一条:
175.18.214.0 * 255.255.255.0 U 0 0 0 eth0
那么ip层经过snat以后,就会把ping包传到eth0这个物理接口,但我在wan侧PC上抓包,并没有抓到ping包过来。我又在router的 ip层的ip_finish_output2()函数里加入打印信息,router的ip层的的确确把ping包发出来了。所以我觉得router没有把 ping包从L3扔到L2。
我想问的是,router在这种特定配置下(wan口的物理eth0加入到了br0中),为什么L3不会把packet传到物理接口eth0?
我看了下kernel代码,也没有看到什么特殊处理,不知道是不是我哪里没有理解正确?
[ 本帖最后由 new_learner 于 2009-3-20 22:01 编辑 ] |
|