18.3 OSPF多區域實驗

OSPF多區域實驗

實驗目的:通過配置路由器實現全網互通

實驗環境:如圖所示,R1、R2、R3屬於區域1,R3是ABR;R4、R5屬於區域0(骨幹區域),R4是ABR;R6屬於區域2,R6是ABR

實驗條件:實現全網互通,且配置末梢區域優化網絡,並分析驗證

實驗步驟:

一 基本配置

配置R1

R1>en

R1#conf t

R1(config)#int f0/0

R1(config-if)#ip add 192.168.1.1 255.255.255.0

R1(config-if)#no shu

配置R2、R3、R4、R5、R6(略)

二 OSPF配置

配置R1

R1(config)#router ospf 1

R1(config-router)#network 192.168.1.0 0.0.0.255 area 1

配置R2

R2(config)#router ospf 1

R2(config-router)#network 192.168.2.0 0.0.0.255 area 1

配置R3

R3(config)#router ospf 1

R3(config-router)#network 192.168.1.0 0.0.0.255 area 1

R3(config-router)#network 192.168.2.0 0.0.0.255 area 1

R3(config-router)#network 192.168.3.0 0.0.0.255 area 0

配置R4

R4(config)#router ospf 1

R4(config-router)#network 192.168.3.0 0.0.0.255 area 0

R4(config-router)#network 192.168.4.0 0.0.0.255 area 0

R4(config-router)#network 192.168.5.0 0.0.0.255 area 2

配置R5

R5(config)#router ospf 1

R5(config-router)#network 192.168.4.0 0.0.0.255 area 0

配置R6

R6(config)#router ospf 1

R6(config-router)#network 192.168.5.0 0.0.0.255 area 2

測試:通過命令查看到每個路由器的路由表中都有五條路由條目,所以全網互通成功

三 優化

將區域1和2都配置爲末梢區域

配置R1

R1(config)#router ospf 1

R1(config-router)#area 1 stub no-summary

配置R2

R2(config)#router ospf 1

R2(config-router)#area 1 stub no-summary

配置R3

R3(config)#router ospf 1

R3(config-router)#area 1 stub no-summary

配置R4

R4(config)#router ospf 1

R4(config-router)#area 1 stub no-summary

R4(config-router)#area 2 stub no-summary

配置R6

R6(config)#router ospf 1

R6(config-router)#area 2 stub no-summary

驗證:查看路由器的路由表,其中末梢區域中的路由器都只學習了本區域內的路由條目,並且增加了一條默認路由條目;但是全網還是互通的

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章