IGP協議的學習即將結束,最後經過一個綜合實驗最爲結尾,實驗拓撲以下圖所示:
每一個路由器的route-id與lo0接口ip地址一致,除基礎配置外,還需知足以下約束: node
OSPF 進程2需求:
1.R4-R5 運行OSPF進程2
2.把OSPF進程2引入進OSPF進程1後要求每一跳metric可變
3.把OSPF進程1引入進OSPF進程2後要求每一跳metric可變
4.要求R4優選R5去往全部網段
5.R4從R5學到的路由條目走2條路徑且等價負載均衡
6.RIP-OSPF進程2之間不作重分佈 網絡
除了基礎的配置,在上圖中還包含了一個隱藏條件,ospf1的area 2沒有與area 0直接相連,這就須要在R2和R3之間創建一條虛鏈路,創建的配置以下: 負載均衡
[R2]ospf 1 [R2-ospf-1]area 1 [R2-ospf-1-area-0.0.0.1]vlink-peer 3.3.3.3 [R3]ospf 1 [R3-ospf-1]area 1 [R3-ospf-1-area-0.0.0.1]vlink-peer 2.2.2.2
ospf的虛鏈路沒法直接經過display ospf peer brief 查看,只能經過虛鏈路查看 less
[R3]display ospf vlink OSPF Process 1 with Router ID 3.3.3.3 Virtual Links Virtual-link Neighbor-id -> 2.2.2.2, Neighbor-State: Full Interface: 23.0.0.3 (Serial2/0/1) Cost: 48 State: P-2-P Type: Virtual Transit Area: 0.0.0.1 Timers: Hello 10 , Dead 40 , Retransmit 5 , Transmit Delay 1 GR State: Normal
此時的基礎配置就以完成,接下來進行約束條件的配置 ide
[R1]rip [R1-rip-1]version 2 network 14.0.0.0 [R4]rip [R4-rip-1]version 2 network 14.0.0.0 network 4.0.0.0 network 199.172.0.0 network 199.172.1.0 network 199.172.2.0 network 199.172.3.0 network 199.172.4.0 network 199.172.5.0
[R1]rip 1 [R1-rip-1]filter-policy ip-prefix RIP import [R1]ip ip-prefix RIP index 10 permit 199.172.0.0 22 greater-equal 24 less-equal 24
[R1]ospf 1 router-id 1.1.1.1
[R1]interface LoopBack 0 [R1-LoopBack0]ospf network-type broadcast
[R1]ospf 1 [R1-ospf-1]area 0 [R1-ospf-1-area-0.0.0.0]authentication-mode md5 1 cipher HUAWEI
在配置區域0認證時須要住的是,雖然R3沒有之間跟area0鏈接,可是R2與R3之間創建了虛鏈路,至關於把area0的範圍擴大了,儘管R3上沒有配置area0,可是仍要創造一個area0來用於認證 oop
<R3>display current-configuration configuration ospf [V200R003C00] # ospf 1 area 0.0.0.0 authentication-mode md5 1 cipher %$%$kcn17z")3I-,au"KJu*4^8!%%$%$ area 0.0.0.1 network 3.3.3.3 0.0.0.0 network 23.0.0.3 0.0.0.0 vlink-peer 2.2.2.2 area 0.0.0.2 network 35.0.0.3 0.0.0.0 # return
[R1]rip 1 [R1-rip-1]import-route ospf 1
[R1]ospf 1 [R1-ospf-1]import-route rip 1 route-policy R-2-O [R1]route-policy R-2-O permit node 10 [R1-route-policy]if-match ip-prefix R-2-O [R1]ip ip-prefix R-2-O permit ip ip-prefix R-2-O index 10 permit 14.0.0.0 24
[R5]ospf 1 [R5-ospf-1]import-route ospf 2 type 1
[R4]rip 1 [R4-rip-1]preference 151
[R4]int g0/0/0 [R4-GigabitEthernet0/0/0]ospf cost 48