|
楼主 |
发表于 2012-4-6 21:12:49
|
显示全部楼层
本帖最后由 弱水无尘 于 2012-4-6 21:15 编辑
showlink 发表于 2012-4-2 17:24
没太看懂你的意思,我估计你理解为R2自己打标记,再过滤自己的标记。
这里的过滤不是ABR自己过滤自己 ...
谢谢两位的解答,这些天工作太忙,直到今天才抽出点时间来看看两位的解答。
我按你的配置做了一遍,但是你看还是不行,你的怎么是好的?你试试配置完成后清掉ospf进程试试
在R2 R3上还是有O E2路由。
下面是R2 R3配置之后的路由表和核心配置,你看看是不是这样的?我试了几次还是被ospf路由覆盖
R2:
Gateway of last resort is not set
R 192.168.10.0/24 [120/1] via 192.168.1.1, 00:00:23, FastEthernet1/0
O 192.168.4.0/24 [110/2] via 192.168.3.4, 00:01:05, FastEthernet1/1
O 192.168.20.0/24 [110/2] via 192.168.3.4, 00:01:05, FastEthernet1/1
C 192.168.1.0/24 is directly connected, FastEthernet1/0
O E2 192.168.2.0/24 [110/20] via 192.168.3.4, 00:01:05, FastEthernet1/1
C 192.168.3.0/24 is directly connected, FastEthernet1/1
router ospf 100
log-adjacency-changes
redistribute rip subnets route-map pbr
network 192.168.3.0 0.0.0.255 area 0
!
router rip
redistribute ospf 100 metric 1 route-map pbr2
network 192.168.1.0
!
ip http server
no ip http secure-server
!
!
!
logging alarm informational
access-list 1 permit 192.168.10.0
access-list 1 permit 192.168.1.0
access-list 1 permit 192.168.2.0
!
!
route-map pbr2 deny 10
match tag 1
!
route-map pbr2 permit 20
!
route-map pbr permit 10
match ip address 1
set tag 1
!
R3:
Gateway of last resort is not set
O E2 192.168.10.0/24 [110/20] via 192.168.4.4,00:01:02,FastEthernet1/0
C 192.168.4.0/24 is directly connected, FastEthernet1/0
O 192.168.20.0/24 [110/2] via 192.168.4.4, 00:01:02, FastEthernet1/0
O E2 192.168.1.0/24 [110/20] via 192.168.4.4, 00:01:02, FastEthernet1/0
C 192.168.2.0/24 is directly connected, FastEthernet1/1
O 192.168.3.0/24 [110/2] via 192.168.4.4, 00:01:02, FastEthernet1/0
!
router ospf 100
log-adjacency-changes
redistribute rip subnets route-map pbr
network 192.168.4.0 0.0.0.255 area 0
!
router rip
redistribute ospf 100 metric 1 route-map pbr2
network 192.168.2.0
!
ip http server
no ip http secure-server
!
!
!
logging alarm informational
!
!
route-map pbr2 deny 10
match tag 1
!
route-map pbr2 permit 20
!
route-map pbr permit 10
match ip address 1
set tag 1
!
你说还没明白我的意思那我再说一遍,我的意思是
router ospf 100
redistribute rip subnets route-map pbr
这条命令的意思是在把rip路由分发到ospf时要根据route-map来过滤是不是?我现在想说的是这条命令根本没用,因为rip路由被ospf路由替换,根本不是充分发过程中导致的,而是充分发之后导致的,注意这句话。为了验证,我开启R3的debug ip routing测试,之后断开R3的F1/0接口再开启,下面是开启端口到路由收敛完毕路由进程进行选取路由的过程,我就挑出了被ospf重复掉的的两条路由
O E2 192.168.10.0/24 [110/20] via 192.168.4.4,00:01:02,FastEthernet1/0
O E2 192.168.1.0/24 [110/20] via 192.168.4.4, 00:01:02, FastEthernet1/0
你可以仔细看看下面的输出,刚开始他们都是从R1出获取的RIP版的192.168.10.0和192.168.1.0,但是之后ospf开启之后你会发现他们都被从R4处发来的路由给覆盖掉了,因为distance更小。
这就说明一个问题他们是被外部路由所覆盖的,而你的命令redistribute rip subnets route-map pbr或者redistribute ospf 100 metric 1 route-map pbr2都是在本地路由器上起作用吧?就是在本地路由器的两个路由进程之间充分发时起作用的,是不是?
之后我为了验证我的猜想,我就做了两个实验用distance-list在每个路由器的和R4相连的接口上过滤OE2 类型的本来属于RIP的三条路由(192.168.10.0,192.168.1.0,192.168.2.0)
结果证明是对的
ospf启动之前:
Apr 6 20:46:19.567: RT: add 192.168.1.0/24 via 192.168.2.1, rip metric [120/1]
ospf启动之后:
*Apr 6 20:46:35.071: RT: closer admin distance for 192.168.1.0, flushing 1 rout
*Apr 6 20:46:35.071: RT: NET-RED 192.168.1.0/24
*Apr 6 20:46:35.071: RT: SET_LAST_RDB for 192.168.1.0/24
NEW rdb: via 192.168.4.4
ospf启动之前:
*Apr 6 20:46:19.579: RT: add 192.168.10.0/24 via 192.168.2.1, rip metric [120/1]
ospf启动之后:
closer admin distance for 192.168.10.0, flushing 1 routes
*Apr 6 20:46:35.079: RT: NET-RED 192.168.10.0/24
*Apr 6 20:46:35.083: RT: SET_LAST_RDB for 192.168.10.0/24
NEW rdb: via 192.168.4.4
*Apr 6 20:46:35.083: RT: add 192.168.10.0/24 via 192.168.4.4, ospf metric [110/
|
22#
2012-4-6 21:12:49
回复(0)
收起回复
|