下载安卓APP箭头
箭头给我发消息

客服QQ:3315713922

OSPF多区域以及配置实例

作者:课课家教育     来源: http://www.kokojia.com点击数:4923发布时间: 2018-01-14 09:00:20

标签: OSPF路由器Cisco数据库

软考,您想通过吗?一次通过才是硬道理

  OSPF(Open Shortest Path First,开放式最短路径优先)是一个内部网关协议(Interior Gateway Protocol,简称IGP),用于在单一自治系统(Autonompus System,AS)内决策路由。是对链路状态路由协议的一种实现,隶属内部网络协议(IGP),故运作于自治系统内部。OSPF通过路由器之间通告网络接口的状态来建立链路状态数据库,生成最短路径树,每个OSPF路由器使用这些最短路径构造路由表。
  作为一种链路状态的路由协议,OSPF将链路状态广播数据包LSA(Link State Advertisement)传送给在某一区域内的所有路由器,这一点与距离矢量路由协议不同。运行距离矢量路由协议的路由器是将部分或全部的路由表传递给与其相邻的路由器。
  1、多区域OSPF的好处
  单区域OSPF中每台路由器都需要维护的路由表越来越大,单区域内路由无法汇总,;收到的LSA通告太多;内部动荡会引起全网路由器的完全SPF计算;资源消耗过多,性能下降,影响数据转发。而多区域OSPF能够减少LSDB的大小,节约带宽;提高路由的效率:缩减部分路由器的OSPF路由条目,降低路由收敛的复杂度,对某些特定的LSA,可以在区域边界上,实现汇总/过滤/控制,而实现全网互通;提高网络的稳定性:当某个区域的某条路由出现抖动时,可以减少受影响的波及面。
  2、区域ID
  区域ID长32bit,其表示范围为0-65535。当设置arer 0时,其区域ID为0.0.0.0;当设置区域area 5时,其区域ID为0.0.0.5;当设置区域area271时,其区域ID为0.0.1.15。
  3、区域设置原则
  1) 作为骨干区域的area0必须存在;
  2) 所有区域,即使是端区,也必须和骨干区域相连;
  3) 如果存在多个骨干区域,那么它们必须连续(逻辑上);什么情况使用多骨干区域?好处是?Area 0只有一个是最好的,当有多个的话就是骨干区域分裂了,做使用虚链路连接
  4) 虚链路只能作为一种应急的临时策略。
  4、区域类型
  1) 骨干区域:负责分发非骨干区域之间的路由选择信息。
  2)普通区域:除骨干区域外,所有为特殊设置的区域。
  3)端区(stub):
  命令:(config-router)#area area-id stub
  作用:可以较少区域内LSDB的规模,降低区域内部路由选择表的大小,并较少区域内部路由器对存储器的需求。
  特点:
  1.区域内所有路由器都应该配置成端路由器。因为端区的路由器通过hello包中的标志位识别区域类型,如果路由器不能达成一致,则不能形成邻居。
  2.其ABR阻止类型LAS4、LSA5。即端区内没有到达外部的路由,但有到达其他区域的路由。
  3.从端区去外部是基于缺省路由的,而且这条缺省路由是自动添加的。
  4)完全端区(total stub):完全端区为Cisco私有的。
  命令:(config-router)#area area-id stub no-summary
  作用:减少OSPF数据库和路由表的规模。
  特点:
  1.每个路由器都要配置成完全端区;
  2.只存在区域内部的路由,拒绝了类型LSA3、LSA4、LSA5;
  3.自动生成缺省路由。(通过特殊的LSA3进去的)
  5)非完全端区(no-so-stubbly-area):
  作用:在端区的基础上允许引进非直连的外部路由选择信息。
  特点:LSA7会被NSSA的ABR路由器转换成LAS5在整个AS支持LSA5的区域内flooding;
  类型:
  1.普通NSSA:
  命令:(config-router)#area area-id nssa
  特点:缺省路由不是自动生成的;拒绝了类型LSA4、LSA5。
  2.完全NSSA:
  命令:(config-router)#area area-id nssa o-summary
  特点:自动生成缺省路由;拒绝了类型LSA3、LSA4、LSA5。
  NSSA使用环境:当区域位于ASBR和ABR之间,且ASBR连接到非OSPF协议网络,ABR连接到OSPF网络骨干区域时就使用NSSA.。想阻止来自其它区域的外部路由,但本区域又想重发布外布的路由。
  5、实验
  OSPF多区域以及配置实例_OSPF_路由器_Cisco_数据库_课课家教育
  实验拓扑及网络规划:如上图
  任务1.按照实验要求连接拓扑。
  任务2.完成所有网络基本IP配置【环回除外】,并测试网络联通性。
  任务3.启动骨干区域AREA 0的OSPF进程。
  实验操作过程及配置说明:
  任务1.按照实验要求连接拓扑。
  IP_路由器_OSPF
  任务2.完成所有网络基本IP配置【环回除外】,并测试网络联通性。
  r1#show ip int bri
  Interface IP-Address OK? Method Status Protocol
  Serial0/0 192.168.1.1 YES manual up up
  Serial0/1 192.168.1.5 YES manual up up
  Serial0/2 192.168.1.9 YES manual up up
  Serial0/3 10.1.1.2 YES manual up up
  r2#show ip int bri
  Interface IP-Address OK? Method Status Protocol
  Serial0/0 192.168.1.2 YES manual up up
  Serial0/1 192.168.1.6 YES manual up up
  Serial0/2 unassigned YES unset administratively down down
  Serial0/3 unassigned YES unset administratively down down
  Ethernet1/0 unassigned YES unset administratively down down
  Ethernet1/1 192.168.1.13 YES manual up up
  Ethernet1/2 unassigned YES unset administratively down down
  r3#show ip int bri
  Interface IP-Address OK? Method Status Protocol
  Serial0/0 unassigned YES unset administratively down down
  Serial0/1 unassigned YES unset administratively down down
  Serial0/2 192.168.1.10 YES manual up up
  Serial0/3 unassigned YES unset administratively down down
  Ethernet1/0 unassigned YES unset administratively down down
  Ethernet1/1 192.168.1.14 YES manual up up
  Ethernet1/2 unassigned YES unset administratively down down
  Ethernet1/3 unassigned YES unset administratively down down
  r4#show ip int bri
  Interface IP-Address OK? Method Status Protocol
  Serial0/0 192.168.12.1 YES manual up up
  Serial0/1 192.168.12.5 YES manual up up
  Serial0/2 192.168.12.9 YES manual up up
  Serial0/3 10.12.12.2 YES manual up up
  r5#show ip int bri
  Interface IP-Address OK? Method Status Protocol
  Serial0/0 192.168.12.2 YES manual up up
  Serial0/1 192.168.12.6 YES manual up up
  Serial0/2 unassigned YES unset administratively down down
  Serial0/3 unassigned YES unset administratively down down
  Ethernet1/0 unassigned YES unset administratively down down
  Ethernet1/1 192.168.12.13 YES manual up up
  Ethernet1/2 unassigned YES unset administratively down down
  Ethernet1/3 unassigned YES unset administratively down down
  r6#show ip int bri
  Interface IP-Address OK? Method Status Protocol
  Serial0/0 unassigned YES unset administratively down down
  Serial0/1 unassigned YES unset administratively down down
  Serial0/2 192.168.12.10 YES manual up up
  Serial0/3 unassigned YES unset administratively down down
  Ethernet1/0 unassigned YES unset administratively down down
  Ethernet1/1 192.168.12.14 YES manual up up
  Ethernet1/2 unassigned YES unset administratively down down
  Ethernet1/3 unassigned YES unset administratively down down
  r7#show ip int bri
  Interface IP-Address OK? Method Status Protocol
  Serial0/0 unassigned YES unset administratively down down
  Serial0/1 10.1.1.1 YES manual up up
  Serial0/2 10.12.12.1 YES manual up up
  Serial0/3 unassigned YES unset administratively down down
  任务3.启动骨干区域AREA 0的OSPF进程。
  r7(config)#router ospf 10
  r7(config-router)#router-id 7.7.7.7
  r7(config-router)#network 10.1.1.1 0.0.0.0 a 0
  r7(config-router)#network 10.12.12.1 0.0.0.0 a 0
  r7(config-router)#end
  r1(config)#router ospf 10
  r1(config-router)#router-id 1.1.1.1
  r1(config-router)#network 10.1.1.2 0.0.0.0 a 0
  r1(config-router)#end
  r4(config)#router ospf 10
  r4(config-router)#router-id 4.4.4.4
  r4(config-router)#network 10.12.12.2 0.0.0.0 a 0
  r4(config-router)#end
  本文对多区域OSPF做了简单的介绍,OSPF协议采用路由器间建立和维护邻接关系,维护链路状态信息数据库,采用最短生成树算法,避免了路由自环。同时,又采用了一些特殊的机制,保证了它在大规模网络中的可用性。

赞(20)
踩(0)
分享到:
上一篇:介绍IPsec协议
推荐查看
华为认证网络工程师 HCIE直播课视频教程