1.实验拓扑:
2.实验要求:
1.使用双点双向重发布。
2.所有路由器进行最佳选路。
3.存在备份路径,不得出现环路和路由回馈。
3.实验步骤:
①.IP地址的配置:
AR1:
[R1]interface GigabitEthernet 0/0/0
[R1-GigabitEthernet0/0/0]ip address 12.1.1.1 255.255.255.0
[R1]interface GigabitEthernet 0/0/1
[R1-GigabitEthernet0/0/1]ip address 14.1.1.1 255.255.255.0
[R1]interface LoopBack 0
[R1-LoopBack0]ip address 1.1.1.1 255.255.255.0
[R1]interface LoopBack 1
[R1-LoopBack1]ip address 172.16.1.1 24
[R1]interface LoopBack 2
[R1-LoopBack2]ip address 172.16.2.1 24
[R1]interface LoopBack 3
[R1-LoopBack3]ip address 172.16.4.1 24
[R1-LoopBack3]rip 1
[R1-rip-1]version 2
[R1-rip-1]network 12.0.0.0
[R1-rip-1]network 1.0.0.0
[R1-rip-1]network 14.0.0.0
[R1-rip-1]network 172.16.0.0
[R1]ip ip-prefix 23 permit 23.1.1.0 24
[R1]interface GigabitEthernet 0/0/1
[R1-GigabitEthernet0/0/1]rip metricout ip-prefix 23 2
[R1]ip ip-prefix 4 permit 4.4.4.0 24
[R1]ip ip-prefix 43 permit 43.1.1.0 24
[R1]interface GigabitEthernet 0/0/0
[R1-GigabitEthernet0/0/0]rip metricin ip-prefix 4 2
[R1-GigabitEthernet0/0/0]rip metricin ip-prefix 43 2
AR2:
[R2]interface GigabitEthernet 0/0/0
[R2-GigabitEthernet0/0/0]ip address 12.1.1.1 255.255.255.0
[R2]interface GigabitEthernet 0/0/1
[R2-GigabitEthernet0/0/1]ip address 23.1.1.2 255.255.255.0
[R2]interface LoopBack 0
[R2-LoopBack0]ip ad
[R2-LoopBack0]ip address 2.2.2.2 255.255.255.0
[R2-LoopBack0]ospf network-type broadcast
[R2]ospf 1
[R2-ospf-1]area 0
[R2-ospf-1-area-0.0.0.0]network 23.1.1.0 0.0.0.255
[R2-ospf-1]import-route direct
[R2-ospf-1]rip 1
[R2-rip-1]version 2
[R2-rip-1]network 12.0.0.0
[R2-rip-1]network 2.0.0.0
[R2-rip-1]import-route direct
[R2-rip-1]import-route ospf 1
[R2]ip ip-prefix 5 permit 4.4.4.0 24
[R2]ip ip-prefix 6 permit 43.1.1.0 24
[R2]ip ip-prefix 1 permit 172.16.1.0 24
[R2]ip ip-prefix 2 permit 172.16.2.0 24
[R2]ip ip-prefix 3 permit 172.16.3.0 24
[R2]ip ip-prefix 4 permit 172.16.4.0 24
[R2]route-policy haha deny node 10
Info: New Sequence of this List.
[R2-route-policy]if-match ip-prefix 1
[R2]route-policy haha permit node 20
Info: New Sequence of this List.
[R2-route-policy]if-match ip-prefix 2
[R2-route-policy]apply cost-type type-1
[R2-route-policy]route-policy haha permit node 30
Info: New Sequence of this List.
[R2-route-policy]if-match ip-prefix 3
[R2-route-policy]apply cost 6
[R2-route-policy]route-policy haha permit node 40
Info: New Sequence of this List.
[R2-route-policy]if-match ip-prefix 4
[R2-route-policy]apply cost-type type-1
[R2-route-policy]route-policy haha permit node 50
Info: New Sequence of this List.
[R2-route-policy]route-policy haha permit node 15
Info: New Sequence of this List.
[R2-route-policy]if-match ip-prefix 5
[R2-route-policy]apply cost-type type-1
[R2-route-policy]if-match ip-prefix 6
[R2-route-policy]apply cost-type type-1
[R2]ospf 1
[R2-ospf-1]import-route rip 1 route-policy haha
AR3:
[R3]ospf 1
[R3-ospf-1]area 0
[R3-ospf-1-area-0.0.0.0]network 3.3.3.0 0.0.0.255
[R3-ospf-1-area-0.0.0.0]network 23.1.1.0 0.0.0.255
[R3-ospf-1-area-0.0.0.0]network 43.1.1.0 0.0.0.255
[R3]interface GigabitEthernet 0/0/0
[R3-GigabitEthernet0/0/0]ip address 34.1.1.1 255.255.255.0
[R3]interface GigabitEthernet 0/0/1
[R3-GigabitEthernet0/0/1]ip address 23.1.1.2 255.255.255.0
[R3]interface LoopBack 0
[R3-LoopBack0]ip address 3.3.3.3 255.255.255.0
AR4:
[R4]interface GigabitEthernet 0/0/0
[R4-GigabitEthernet0/0/0]ip address 14.1.1.4 255.255.255.0
[R4]interface GigabitEthernet 0/0/1
[R4-GigabitEthernet0/0/1]ip address 34.1.1.4 255.255.255.0
[R4]interface LoopBack 0
[R4-LoopBack0]ip address 4.4.4.4 255.255.255.0
[R4-LoopBack0]ospf network-type broadcast
[R4-LoopBack0]rip 1
[R4-rip-1]version 2
[R4-rip-1]network 14.0.0.0
[R4-rip-1]import-route direct
[R4-rip-1]import-route ospf 1
[R4]ip ip-prefix 5 permit 23.1.1.0 24
[R4]ip ip-prefix 6 permit 2.2.2.0 24
[R4]ip ip-prefix 1 permit 172.16.1.0 24
[R4]ip ip-prefix 2 permit 172.16.2.0 24
[R4]ip ip-prefix 3 permit 172.16.3.0 24
[R4]ip ip-prefix 4 permit 172.16.4.0 24
[R4]route-policy haha deny node 10
Info: New Sequence of this List.
[R4-route-policy]if-match ip-prefix 1
[R4-route-policy]route-policy haha permit node 20
Info: New Sequence of this List.
[R4-route-policy]if-match ip-prefix 2
[R4-route-policy]apply cost-type type-1
[R4-route-policy]route-policy haha permit node 30
Info: New Sequence of this List.
[R4-route-policy]if-match ip-prefix 3
[R4-route-policy]apply cost 6
[R4-route-policy]route-policy haha permit node 40
Info: New Sequence of this List.
[R4-route-policy]if-match ip-prefix 4
[R4-route-policy]apply cost 9
[R4-route-policy]apply cost-type type-1
[R4-route-policy]route-policy haha permit node 15
[R4-route-policy]if-match ip-prefix 5
[R4-route-policy]apply cost-type type-1
[R4-route-policy]route-policy haha permit node 25
Info: New Sequence of this List.
[R4-route-policy]if-match ip-prefix 6
[R4-route-policy]apply cost-type type-1
[R4]ospf 1
[R4-ospf-1]import-route rip 1 route-policy haha