(1)两个协议间进行多点双向重发布。
(2)R7的环回没有宣告在OSPF协议中,而是后期重发布进入的。
(3)解决环路,所有路径选择最优,且存在备份。
配置多项重发布 重发布r7环回 解决环路,选路最优,留备份
配置ip
[r1]int g0/0/0
[r1-GigabitEthernet0/0/0]ip add 12.1.1.1 24
[r1-GigabitEthernet0/0/0]int g0/0/1
[r1-GigabitEthernet0/0/1]ip add 13.1.1.1 24
[r1-GigabitEthernet0/0/1]int lo 0
[r1-LoopBack0]ip add 1.1.1.1 24
[r2]int g0/0/0
[r2-GigabitEthernet0/0/0]ip add 12.1.1.2 24
[r2-GigabitEthernet0/0/0]int g0/0/1
[r2-GigabitEthernet0/0/1]ip add 14.1.1.1 24
[r2-GigabitEthernet0/0/1]int lo 0
[r2-LoopBack0]ip add 2.2.2.2 24
[r3]int g0/0/0
[r3-GigabitEthernet0/0/0]ip add 13.1.1.2 24
[r3-GigabitEthernet0/0/0]int g0/0/1
[r3-GigabitEthernet0/0/1]ip add 15.1.1.1 24
[r3-GigabitEthernet0/0/1]int lo 0
[r3-LoopBack0]ip add 3.3.3.3 24
[r4]int g0/0/0
[r4-GigabitEthernet0/0/0]ip add 14.1.1.2 24
[r4-GigabitEthernet0/0/0]int g0/0/1
[r4-GigabitEthernet0/0/1]ip add 15.1.1.2 24
[r4-GigabitEthernet0/0/1]int g0/0/2
[r4-GigabitEthernet0/0/2]ip add 25.1.1.1 24
[r4-GigabitEthernet0/0/2]int lo 0
[r4-LoopBack0]ip add 4.4.4.4 24
[r5]int g0/0/0
[r5-GigabitEthernet0/0/0]ip add 25.1.1.2 24
[r5-GigabitEthernet0/0/0]int g0/0/1
[r5-GigabitEthernet0/0/1]ip add 26.1.1.1 24
[r5-GigabitEthernet0/0/1]int lo 0
[r5-LoopBack0]ip add 5.5.5.5 24
[r6]int g0/0/0
[r6-GigabitEthernet0/0/0]ip add 26.1.1.2 24
[r6-GigabitEthernet0/0/0]int g0/0/1
[r6-GigabitEthernet0/0/1]ip add 27.1.1.1 24
[r6-GigabitEthernet0/0/1]int lo 0
[r6-LoopBack0]ip add 6.6.6.6 24
[r7]int g0/0/0
[r7-GigabitEthernet0/0/0]ip add 27.1.1.2 24
[r7-GigabitEthernet0/0/0]int lo 0
[r7-LoopBack0]ip add 7.7.7.7 24
宣告
[r1]rip 1
[r1-rip-1]ver 2
[r1-rip-1]network 12.0.0.0
[r1-rip-1]network 13.0.0.0
[r1-rip-1]network 1.0.0.0
[r2]rip 1
[r2-rip-1]ver 2
[r2-rip-1]network 12.0.0.0
[r2-rip-1]network 14.0.0.0
[r2-rip-1]undo network 14.0.0.0
[r2-rip-1]network 2.0.0.0
[r2]ospf 1 router-id 2.2.2.2
[r2-ospf-1]area 0
[r2-ospf-1-area-0.0.0.0]network 14.1.1.0 0.0.0.255
[r3]rip 1
[r3-rip-1]ver 2
[r3-rip-1]network 13.0.0.0
[r3]ospf 1 router-id 3.3.3.3
[r3-ospf-1]area 0
[r3-ospf-1-area-0.0.0.0]network 3.3.3.3 0.0.0.0
[r3-ospf-1-area-0.0.0.0]network 15.1.1.0 0.0.0.255
[r4]ospf 1 router-id 4.4.4.4
[r4-ospf-1]area 0
[r4-ospf-1-area-0.0.0.0]network 4.4.4.4 0.0.0.0
[r4-ospf-1-area-0.0.0.0]network 14.1.1.0 0.0.0.255
[r4-ospf-1-area-0.0.0.0]network 15.1.1.0 0.0.0.255
[r4-ospf-1-area-0.0.0.0]network 25.1.1.0 0.0.0.255
[r5]ospf 1 router-id 5.5.5.5
[r5-ospf-1]area 0
[r5-ospf-1-area-0.0.0.0]network 25.1.1.0 0.0.0.255
[r5-ospf-1-area-0.0.0.0]network 26.1.1.0 0.0.0.255
[r6]ospf 1 router-id 6.6.6.6
[r6-ospf-1]area 0
[r6-ospf-1-area-0.0.0.0]network 26.1.1.0 0.0.0.255
[r6-ospf-1-area-0.0.0.0]network 27.1.1.0 0.0.0.255
[r7]ospf 1 router-id 7.7.7.7
[r7-ospf-1]area 0
[r7-ospf-1-area-0.0.0.0]network 27.1.1.0 0.0.0.255
配置重发布
[r7]ospf 1 router-id 7.7.7.7
[r7-ospf-1]import-route direct
[r2]rip 1
[r2-rip-1]import-route ospf 1
[r2]ospf 1 router-id 2.2.2.2
[r2-ospf-1]import-route rip 1
[r3]ospf 1 router-id 3.3.3.3
[r3-ospf-1]import-route rip 1
[r3]rip 1
[r3-rip-1]import-route ospf 1
出现路由回馈
一个是OSPF内部学习到的/32的路由,另一个是R3重发布进rip,再由R2重发布进了OSPF学习到了/24的路由,导致了路由回馈。
修改R3的环回OSPF的接口工作方式为broadcast
[r3]int lo 0
[r3-LoopBack0]ospf network-type broadcast
选路不佳
重发布进入的路由洗掉原有度量,默认为type-2 ,默认度量值为1,不叠加内部度量。故产生了所有路由的负载均衡。
增加cost值,来干涉选路。(r3为例)
[r3]ip ip-prefix A index 10 permit 13.1.1.0 24
[r3]ip ip-prefix B index 10 permit 15.1.1.0 24
[r3]ip ip-prefix B index 20 permit 2.2.2.2 32
[r3]route-policy a permit node 10
[r3-route-policy]if-match ip-prefix A
[r3-route-policy]apply cost 10
[r3]route-policy a permit node 20
[r3-route-policy]q
[r3]route-policy b permit node 10
[r3-route-policy]if-match ip-prefix B
[r3-route-policy]apply cost 10
[r3]route-policy b permit node 20
[r3]ospf 1 router-id 3.3.3.3
[r3-ospf-1]import-route rip 1 route-policy b
[r3]rip 1
[r3-rip-1]ver 2
[r3-rip-1]import-route ospf 1 route-policy a
出现环路
在r7到r3时,可以走r2过,也可以直接到r3,但是rip的值是100,ospf是150,所以他选择走r2绕路,但是,到r3之后他还会重发布给r4,r4给r5,最终给到r7
将7.7.7.7的优先级导入rip时增大(超过150),然后再rip中调用.R2和R3上都进行配置。
(r2例)
[r2]ip ip-prefix qq index 10 permit 7.7.7.7 32
[r2]route-policy qq permit node 10
[r2-route-policy]if-match ip-prefix qq
[r2-route-policy]apply preference 151
[r2-route-policy]q
[r2]rip 1
[r2-rip-1]ver 2
[r2-rip-1]preference route-policy qq