一,实验要求
1.两个协议之间进行多点双向重发布。
2.R7的环回没有宣告在OSPF协议中,而是后期重发布进入。
3.解决环路,所有路径选择最优,且存在备份。
二,实验拓扑
三,实验步骤
1.根据实验拓扑进行IP地址规划
R1
[R1-GigabitEthernet0/0/1]ip add 12.1.1.1 24
[R1-GigabitEthernet0/0/0]ip add 13.1.1.1 24
[R1-LoopBack0]ip add 1.1.1.1 24
R2
[R2-GigabitEthernet0/0/0]ip add 12.1.1.2 24
[R2-GigabitEthernet0/0/1]ip add 24.1.1.1 24
[R2-LoopBack0]ip add 2.2.2.2 24
R3
[R3-GigabitEthernet0/0/1]ip add 13.1.1.2 24
[R3-GigabitEthernet0/0/0]ip add 34.1.1.1 24
[R3-LoopBack0]ip add 3.3.3.3 24
R4
[R4-GigabitEthernet0/0/0]ip add 24.1.1.2 24
[R4-GigabitEthernet0/0/1]ip add 34.1.1.2 24
[R4-GigabitEthernet0/0/2]ip add 45.1.1.1 24
[R4-LoopBack0]ip add 4.4.4.4 24
R5
[R5-GigabitEthernet0/0/0]ip add 45.1.1.2 24
[R5-GigabitEthernet0/0/1]ip add 56.1.1.1 24
[R5-LoopBack0]ip add 5.5.5.5 24
R6
[R6-GigabitEthernet0/0/0]ip add 56.1.1.2 24
[R6-GigabitEthernet0/0/1]ip add 67.1.1.1 24
[R6-LoopBack0]ip add 6.6.6.6 24
R7
[R7-GigabitEthernet0/0/0]ip add 67.1.1.2 24
[R7-LoopBack0]ip add 7.7.7.7 24
2.开启rip和ospf协议
R1
[R1]rip 1
[R1-rip-1]ver 2
[R1-rip-1]network 1.0.0.0
[R1-rip-1]network 12.0.0.0
[R1-rip-1]network 13.0.0.0
R2
[R2]ospf 1 router-id 2.2.2.2
[R2-ospf-1-area-0.0.0.0]network 24.1.1.1 0.0.0.0
[R2]rip 1
[R2-rip-1]ver 2
[R2-rip-1]network 2.0.0.0
[R2-rip-1]network 12.0.0.0
R3
[R3]ospf 1 router-id 3.3.3.3
[R3-ospf-1-area-0.0.0.0]network 34.1.1.1 0.0.0.0
[R3-ospf-1-area-0.0.0.0]network 3.3.3.3 0.0.0.0
[R3]rip 1
[R3-rip-1]ver 2
[R3-rip-1]network 13.0.0.0
R4
[R4]OSPF 1 router-id 4.4.4.4
[R4-ospf-1-area-0.0.0.0]network 24.1.1.2 0.0.0.0
[R4-ospf-1-area-0.0.0.0]network 34.1.1.2 0.0.0.0
[R4-ospf-1-area-0.0.0.0]network 45.1.1.1 0.0.0.0
[R4-ospf-1-area-0.0.0.0]network 4.4.4.4 0.0.0.0
R5
[R5]ospf 1 router-id 5.5.5.5
[R5-ospf-1-area-0.0.0.0]network 45.1.1.2 0.0.0.0
[R5-ospf-1-area-0.0.0.0]network 56.1.1.1 0.0.0.0
[R5-ospf-1-area-0.0.0.0]network 5.5.5.5 0.0.0.0
R6
[R6]ospf 1 router-id 6.6.6.6
[R6-ospf-1-area-0.0.0.0]network 56.1.1.2 0.0.0.0
[R6-ospf-1-area-0.0.0.0]network 67.1.1.1 0.0.0.0
[R6-ospf-1-area-0.0.0.0]network 6.6.6.6 0.0.0.0
R7
[R7]ospf 1 router-id 7.7.7.7
[R7-ospf-1-area-0.0.0.0]network 67.1.1.2 0.0.0.0
3.将R7上的环回重发布
[R7]ospf 1
[R7-ospf-1]import-route direct
4.对R2,R3进行双向重发布
R2
[R2]ospf 1
[R2-ospf-1]import-route rip 1
[R2]rip 1
[R2-rip-1]import-route ospf 1
R3
[R3]rip 1
[R3-rip-1]import-route ospf 1
[R3]ospf 1
[R3-ospf-1]import-route rip 1
4.解决R1 R2 R3 R4的环路问题
R2
[R2]ip ip-prefix a index 10 permit 7.7.7.0 24
[R2]route-policy q permit node 10
[R2-route-policy]if-match ip-prefix q
[R2-route-policy]apply preference 151
[R2]rip 1
[R2-rip-1]preference route-policy q
R3
[R3]ip ip-prefix a index 10 permit 7.7.7.0 24
[R3]route-policy q permit node 10
[R3-route-policy]if-match ip-prefix q
[R3-route-policy]apply preference 151
[R3]rip 1
[R3-rip-1]preference route-policy q
5.路由优化
R2
[R2]ip ip-prefix qq permit 3.3.3.0 24
[R2]ip ip-prefix qq permit 34.1.1.0 24
[R2-GigabitEthernet0/0/0]rip metricout ip-prefix qq 2
R3
[R3]ip ip-prefix qq permit 24.1.1.0 24
[R3-GigabitEthernet0/0/1]rip metricout ip-prefix qq 2