一、题目要求
1.两个协议间进行多点双向重发布
2.R7的环回没有宣告在OSPF协议中,而且是后期重发布进去
3.解决环路,所有路径选择最优,且存在备份
二、搭建拓扑
三、底层IP配置
[r1]interface GigabitEthernet0/0/0
[r1-GigabitEthernet0/0/0]ip address 12.1.1.1 24
[r1]interface GigabitEthernet0/0/1
[r1-GigabitEthernet0/0/1]ip address 13.1.1.1 24
[r1]int lo0
[r1-LoopBack0]ip address 1.1.1.1 24
[r2]interface GigabitEthernet0/0/0
[r2-GigabitEthernet0/0/0]ip address 12.1.1.2 24
[r2]interface GigabitEthernet0/0/1
[r2-GigabitEthernet0/0/1]ip address 24.1.1.1 24
[r2]int lo0
[r2-LoopBack0]ip address 2.2.2.2 24
[r3]interface GigabitEthernet0/0/0
[r3-GigabitEthernet0/0/0]ip address 13.1.1.2 24
[r3]interface GigabitEthernet0/0/1
[r3-GigabitEthernet0/0/1]ip address 34.1.1.1 24
[r3]int lo0
[r3-LoopBack0]ip address 3.3.3.3 24
[r4]interface GigabitEthernet0/0/0
[r4-GigabitEthernet0/0/0]ip address 34.1.1.2 24
[r4]interface GigabitEthernet0/0/1
[r4-GigabitEthernet0/0/1]ip address 24.1.1.2 24
[r4]interface GigabitEthernet0/0/2
[r4-GigabitEthernet0/0/2]ip address 45.1.1.1 24
[r4]int lo0
[r4-LoopBack0]ip address 4.4.4.4 24
[r5]interface GigabitEthernet0/0/0
[r5-GigabitEthernet0/0/0]ip address 45.1.1.2 24
[r5]interface GigabitEthernet0/0/1
[r5-GigabitEthernet0/0/1]ip address 56.1.1.1 24
[r5]int lo0
[r5-LoopBack0]ip address 5.5.5.5 24
[r6]interface GigabitEthernet0/0/0
[r6-GigabitEthernet0/0/0]ip address 56.1.1.2 24
[r6]interface GigabitEthernet0/0/1
[r6-GigabitEthernet0/0/1]ip address 67.1.1.1 24
[r6]int lo0
[r6-LoopBack0]ip address 6.6.6.6 24
[r7]interface GigabitEthernet0/0/0
[r7-GigabitEthernet0/0/0]ip address 67.1.1.2 24
[r7]int lo0
[r7-LoopBack0]ip address 7.7.7.7 24
四、开启RIP与OSPF路由协议
[r1]rip 1
[r1-rip-1]version 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]rip 1
[r2-rip-1]version 2
[r2-rip-1]network 2.0.0.0
[r2-rip-1]network 12.0.0.0
[r2-rip-1]q
[r2]ospf 1
[r2-ospf-1]area 0.0.0.0
[r2-ospf-1-area-0.0.0.0]network 24.1.1.0 0.0.0.255
[r3]rip 1
[r3-rip-1]version 2
[r3-rip-1]network 13.0.0.0
[r3-rip-1]q
[r3]ospf 1
[r3-ospf-1]area 0.0.0.0
[r3-ospf-1-area-0.0.0.0]network 34.1.1.0 0.0.0.255
[r3-ospf-1-area-0.0.0.0]network 3.3.3.3 0.0.0.0
[r4]ospf 1
[r4-ospf-1]area 0.0.0.0
[r4-ospf-1-area-0.0.0.0]network 24.1.1.0 0.0.0.255
[r4-ospf-1-area-0.0.0.0]network 34.1.1.0 0.0.0.255
[r4-ospf-1-area-0.0.0.0]network 45.1.1.0 0.0.0.255
[r4-ospf-1-area-0.0.0.0]network 4.4.4.4 0.0.0.0
[r5]ospf 1
[r5-ospf-1]area 0.0.0.0
[r5-ospf-1-area-0.0.0.0]network 56.1.1.0 0.0.0.255
[r5-ospf-1-area-0.0.0.0]network 45.1.1.0 0.0.0.255
[r5-ospf-1-area-0.0.0.0]network 5.5.5.5 0.0.0.0
[r6]ospf 1
[r6-ospf-1]area 0.0.0.0
[r6-ospf-1-area-0.0.0.0]network 56.1.1.0 0.0.0.255
[r6-ospf-1-area-0.0.0.0]network 67.1.1.0 0.0.0.255
[r6-ospf-1-area-0.0.0.0]network 6.6.6.6 0.0.0.0
[r7]ospf 1
[r7-ospf-1]area 0.0.0.0
[r7-ospf-1-area-0.0.0.0]network 67.1.1.0 0.0.0.255
五、重发布
[r7]ospf 1
[r7-ospf-1]import-route direct ---将R7的环路以直连接口的形式重发布
[r2]rip 1
[r2-rip-1]import-route ospf 1
[r2-rip-1]q
[r2]ospf 1
[r2-ospf-1]import-route rip 1
[r3]rip 1
[r3-rip-1]import-route ospf 1
[r3-rip-1]q
[r3]ospf 1
[r3-ospf-1]import-route rip 1
六、路由策略
1.解决出环问题:
[r2]ip ip-prefix a index 10 permit 7.7.7.0 24
[r2]route-policy a permit node 10
[r2-route-policy]if-match ip-prefix aa
[r2-route-policy]apply preference 151
[r2]rip 1
[r2-rip-1]preference route-policy aa
[r3]ip ip-prefix a index 10 permit 7.7.7.0 24
[r3]route-policy a permit node 10
[r3-route-policy]if-match ip-prefix aa
[r3-route-policy]apply preference 151
[r3]rip 1
[r3-rip-1]preference route-policy aa
配置完成后,环路消失
2. 路由优化问题:
[r2]ip ip-prefix 1 index 10 permit 3.3.3.0 24
[r2]ip ip-prefix 1 index 20 permit 34.1.1.0 24
[r2]interface GigabitEthernet0/0/0
[r2-GigabitEthernet0/0/0]rip metricout ip-prefix 1 2
[r3]ip ip-prefix 1 index 10 permit 24.1.1.0 24
[r3]interface GigabitEthernet0/0/0
[r3-GigabitEthernet0/0/0]rip metricout ip-prefix 1 2