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
验证:查看路由器的路由表,其中末梢区域中的路由器都只学习了本区域内的路由条目,并且增加了一条默认路由条目;但是全网还是互通的