1、多区域OSPF,互连多个OSPF区域,1,多个OSPF区域;(路由器类型;LSA类型;区域类型)2,在多个区域上的OSPF运行;(LSA变化,虚链路)3,使用和配置OSPF的多区域组件;(末节区域,完全末节区域,多区域的NBMA环境;路由归纳配置虚链路)4,验证OSPF的运行,思考:,只有单个区域时,广域网中会有什么问题?,Issues with Maintaining a Large OSPF Network,创建多个OSPF区域,多区域OSPF是一种层次化的结构,优点如下:SPF计算频率降低,路由表变小,链路状态更新(LSU)额外开销降低.,The Solution: OSPF Hiera
2、rchical Routing,Consists of areas and autonomous systemsMinimizes routing update traffic,一,OSPF多区域路由器类型,1,OSPF路由器的类型;内部路由器:inter-area router主干路由器:backbone router区域边界路由器:ABR自治系统边界路由器: ASBR,Types of OSPF Routers,Types of OSPF Routers (Cont.),Types of OSPF Routers (Cont.),Types of OSPF Routers (Cont.),
3、Types of OSPF Routers,二,链路状态通告类型,LSA1:只在特定区域内进行扩散.LSA2:由指定路由器在多路访问型网络中生成.LSA3:由ABR产生,通过主干区域传递到其他的ABR.IALSA4:由ABR产生,描述ASBR的可达性.IALSA5:由ASBR产生,用来描述到自治系统外部目的地的路由。LSA6:用于增强OSPF功能。LSA7:由一个连接到NSSA的ASBR产生;类型七LSA可以在NSSA内进行扩散,并可以被ABR转换为类型五的LSA消息。,Link-State Advertisement Types,LSA链路状态宣告类型111,LSA Type 1: Rout
4、er LSA,每个区域的每个路由器都会产生一条关于自身的Router LSA:包含了直连链路的信息列表通过IP前缀对链路进行区别通过源路由器的RID进行鉴别在区域内洪泛,但是不会穿越ABR,LSA Type 2: Network LSA,network (type 2) LSA 仍然由本区域产生描述了所有和DR相连的路由器的信息(包括DR本身)包含链路的子网掩码在多路访问网络中,DR产生 Network LSA本区域内洪泛,不会穿越ABR,LSA Type 3: Summary LSA,Type 3 summary LSAs 用来把本区域的网络信息传播到其他区域中去描述了网络号和掩码信息由AB
5、R产生在整个OSPF域中洪泛,LSA Type 4: Summary LSA,Summary (type 4) LSAs 宣告的不是网络,而是ASBR信息仍然又ABR产生.在整个OSPF域中洪泛后续的ABR将对ASBR Summary LSA重新生成.只包含ASBR的RID信息.,LSA Type 5: External LSA,External (type 5) LSAs 用来宣告OSPF区域外部的网络信息仅由 ASBR产生.在整个OSPF路由域中洪泛ASBR 的router ID 在穿越 AS时不会发生改变.需要类型4的LSA来发现ASBR,OSPF区域类型;,标准区域:能够接收链路更新和
6、路由归纳。主干区域:区域0末节区域:不接收AS外的路由信息。完全末节区域:不接收AS外或AS内其他域内的路由信息,使用缺省路由向外转发IP包。次末节区域NSSA:类似末节区域,但接收有限数量的外部路由,如类型七,并能将类型七路由转换为类型五的路由。,Types of Areas,Types of Areas (Cont.),1,STUB AREA不接收类型5;2,STUB AREA不能有ASBR;只有一个ABR;3,不能有虚电路穿越它;它们可以通过虚电路与主干区域相连;4,主干区域不可能是STUB区域;,Types of Areas,Using Stub Areas,Stub Area Con
7、figuration,Area area-id stub,router ospf 10 network 130.130.32.0 0.0.31.255 area 1 network 130.130.0.0 0.0.31.255 area 0 area 1 stub,This router subordinate command turns on stub area networking.All routers in a stub area must use the stub command.,RouterA(config-router)#,Using Totally Stubby Areas,
8、1,不能有ASBR2,只能配在思科路由器上,area area-id stub no-summary (只用于ABR上,是思科特有的),The addition of no-summary creates a totally stubby area.(不要将汇总的路由发布到TOTALLY区域中)The no-summary option prevents all summary LSAs from entering the stub area.,Totally Stubby Commands,RouterA(config-router)#,Routing Tables with Differe
9、nt Areas,Routing Tables for Stub Area,ABR上产生的缺省路由;简洁多了!,Routing Tables for Totally Stubby Area,Not-So-Stubby Areas(非完全末节区域),Breaks stub area rules ASBR (R1) is allowed in NSSA,Special LSA type 7 defined, sent by ASBR ABR (R2) converts LSA 7 to LSA 5,NSSA Configuration,show ip ospf,Displays which are
10、as are normal, stub, or NSSA,The show Commands for Stub and NSSA,show ip ospf database,Displays LSA type 7 updates,show ip ospf database nssa-external,Displays specific details of each LSA type 7 update in database,show ip route,Displays NSSA routes with code O N2 or O N1,RouterA#,RouterA#,RouterA#,
11、RouterA#,使用末节区域和完全末节区域,1,末节区域和完全末节区域的标准末节区域作用:不接受与AS外部路由有关信息。完全末节区域作用:Cisco专有特性,域内路由和缺省路由是区域所知道的唯一信息。2,配置末节和完全末节区域Router ospf 1Network 192.168.0.0 0.0.0.255 area 1Area 1 stub在末节区域中的所有路由器接口必须配置Area 51 stub NO-summary只须在ABR上加上NO-summary,使用和配置NSSA,NSSA:次末节区域,通过将一个区域配置为NSSA,我们可以在减小区域中的路由表,但仍能将外部路由信息输入到O
12、SPF中。(仅IOS11.2以上版本)Nssa可以简化管理。案例练习,小结,在多区域中,有七种LSA类型多区域中的五种区域类型虚链路可以被用来在一个非直连区域和区域0之间提供逻辑连接,The show ip route Command,RTA# show ip route Codes:C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP, D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area, E1 - OSPF external type 1,
13、 E2 - OSPF external type 2, E - EGP, i - IS-IS, L1 - IS-ISlevel-1, L2 - IS-IS level-2, * - candidate defaultGateway of last resort is 203.250.15.67 to network 0.0.0.0203.250.16.0 255.255.255.192 is subnetted, 1 subnetsO E2203.250.16.128 110/10 via 203.250.15.67, 00:00:50, Ethernet0203.250.13.0 255.2
14、55.255.255 is subnetted, 1 subnetsC203.250.13.41 is directly connected, Loopback0203.250.15.0 255.255.255.192 is subnetted, 3 subnetsO IA203.250.15.0 110/74 via 203.250.15.67, 00:00:50, Ethernet0C203.250.15.64 is directly connected, Ethernet0C203.250.15.192 is directly connected, Ethernet1O*E20.0.0.
15、0 0.0.0.0 110/10 via 203.250.15.67, 00:00:50, Ethernet0,配置OSPF在多个区域上的运行,1,扩散LSU到多个区域首先在区域内同步LSA1.2;然后ABR检查域内的链路状态数据库,生成汇总LSA3.4;通过ABR发送出去(交换状态或完全末节)。最后,ASBR或ABR收到汇总LSA5.7后,扩散到其本地区域。2,更新路由表A,首先计算到区域内的目的地的路径。B,然后计算到本AS内其他区域的路径;如果同时存在一条域间路由和域内路由,则保留域内路由。C,计算到区域外部网络的路径。,使用和配置OSPF的多区域组件,1,配置ABR接口处于不同区域中,
16、自动成为ABR。 当配置重发布时,它自动成ASBR。Show ip ospf2,配置OSPF路由归纳主要是用来保护路由器避免不必要的路由表重新计算。Router Ospf 1对ASBR外部的路由进行路由归纳Summary-address 200.9.0.0 255.255.0.0Router ospf 1执行AREA1到AREA0的路由归纳Area 1 range 192.168.16.0 255.255.252.0,Benefits of Route Summarization,最小化路由表条目数当拓扑发生改变时使影响局部化减少类型3和类型5的洪泛,节约CPU资源,Using Route S
17、ummarization,区域间汇总路由带子网掩码一个或多个条目可以表示多个子网,area area-id range address mask,Router(config-router)#,Consolidates inter-area (IA) routes on an ABR,Configuring Route Summarization,summary-address address mask not-advertise tag tag,Router(config-router)#,Consolidates external routes, usually on an ASBR,Rou
18、te Summarization Configuration Example at ABR,Route Summarization Configuration Example at ASBR,RIPv2 must be redistributed into OSPF,Default Routes in OSPF,A default route is injected into OSPF as an external LSA type 5.Default route distribution is not on by default; use a default-information orig
19、inate command under the OSPF routing process.,default-information originate always,Router(config-router)#,A router ospf subordinate commandNormally, this command only advertises a 0.0.0.0 default into the OSPF network if the default route already exists in the routing tableThe always keyword allows
20、the 0.0.0.0 default to be advertised even when the default route does not exist in the routing table,Configuring OSPF Default Routes,Default Route Configuration Example,主干区域的要点:,1,主干区域必须被设为区域0。2,当两个区域0不相连时,需要使用虚链路技术。一般当两个公司合并时,可能会发生。当路由器失效时,导致主干区域被分成两部分时,以提供容错功能。Router ospf 1 Area 3 virtual-link 10.
21、0.0.1,Defining Virtual Links,Virtual links are used to connect a discontiguous area to area 0.(用于连接主干区域) A logical connection is built between router A and router B.(是A和B之间的逻辑连接) Virtual links are recommended for backup or temporary connections.(用于备份连接),OSPF Virtual Link Configuration Example 2,常见于公
22、司的合并;或做备份连接!,Illegal Area Connections,By default, all areas must connect to area 0. Area 4 is connected incorrectly. There may be times when this type of connectivity is required.,Configuring Virtual Links,area area-id virtual-link router-id,Router(config-router)#,Creates a virtual link,remoterouter
23、# show ip ospf interface ethernet 0Ethernet0 is up, line protocol is up Internet Address 10.64.0.2/24, Area 0 Process ID 1, Router ID 10.64.0.2, Network Type BROADCAST, Cost: 10 Transmit Delay is 1 sec, State DR, Priority 1 Designated Router (ID) 10.64.0.2, Interface address 10.64.0.2 Backup Designa
24、ted router (ID) 10.64.0.1, Interface address 10.64.0.1,OSPF Virtual Link Configuration Example 1,ROUTER ID如何确定? show ip ospf interface ethernet 0,The show ip ospf virtual-links Command,Router# show ip ospf virtual-linksVirtual Link to router 10.2.2.2 is up Transit area 0.0.0.1, via interface Etherne
25、t0, Cost of using 10 Transmit Delay is 1 sec, State POINT_TO_POINT Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5 Hello due in 0:00:08 Adjacency State FULL,检验多区域OSPF的运行,Show ip ospf border-routersShow ip ospf virtual-linksShow ip ospf process-idShow ip ospf databaseClear ip ospf process (yes),lab,多区域OSPF(NBMA)配置末节区域配置完全末节区域配置NSSA配置虚链路,