OSPF 特殊区域的配置案例
ospf的四种特殊区域(通俗易懂)
stub(末节区域):使用的前提:如下图示,非骨干路由和其它路由协议(静态、EIGRP、RIP...)均要与骨干路由直连。
作用是:把一个非骨干区域配置成stub区域,而stub区域路由器将从其它协议重分布到OSPF的路由条目(OE1、OE2)替换成默认路由指向骨干区域。
如下图所示:在R1、R2(即ABR)上配置,配置命令如下:R1/R2:router ospf 1area 100stub结果是:由于R2既是处于area 100,又处于area 0,所以,当“show ip route ospf”的时候,只有R1上的OSPF路由条目(OE1、OE2)会被替换成默认路由指向骨干路由,而R2上的路由条目是不会被替换的。
当然,此图右边使用的是EIGRP,也可以使用除OSPF外的其他路由协议,因为,我们要在R3上做“路由重分布”。
totally-stub(完全末节区域):使用的前提条件和stub的一样,只是totally-stub要更“狠”,它的作用是:将从它路由协议重分布到OSPF的路由条目(OE1、OE2)及OIA(区域间学习到的路由)全部替换成默认路由指向骨干区域,但配置命令与上述还是有一点点差别的:R1:router ospf 1area 100 stubR2: router ospf 1area 100 stub no-summary结果:也是只有R1上的所有OSPF路由条目(包括OE1、OE2机OIA)被替换成了一条默认路由指向骨干路由。
nssa和totally-nssa的使用前提是一样的,即当OSPF区域跨非骨干区域连接到骨干区域时,如下图所示,RIP跨了area 10连接到了area 0。
而两者的作用有点不同。
nssa(次末节区域):作用是将从连接骨干区域出口的其它路由协议重发布来的(OE1、OE2)替换成默认路由指向骨干区域配置命令:R2和R3:router ospf 1area 10 nssaR4: router ospf 1area 10 nssa default-information-originatetotally-nssa(完全次末节区域):作用是将从连接骨干区域出口的其它路由协议重发布来的(OE1、OE2)及区域间学习到的路由(OIA)替换成默认路由指向骨干区域。
华为OSPF 特殊区域完全NSSA 区域的配置及区域路由汇总
华为OSPF 特殊区域完全NSSA 区域的配置及区域路由汇总作者:救世主220实验日期2015.6.28实验拓扑如下:说明:AR3上的loopback9 作为外部路由,其余的nssa区域路由传入AREA0的时候进行汇总从而减少AR1上的路由条目;AR1 开启Telnet功能并且禁止any登录。
AR1 配置:[AR1]dis cur[V200R003C00]sysname AR1#acl number 3000rule 5 deny tcp destination 10.0.1.1 0rule 10 deny tcp destination 10.0.12.1 0#aaalocal-user ccie password cipher %$%$2P6NSU818+S,I[-}w2Q)V@O~%$%$(此处乱码为密码ccie)local-user ccie privilege level 3local-user ccie service-type telnet#interface GigabitEthernet0/0/0ip address 10.0.12.1 255.255.255.0traffic-filter inbound acl 3000#interface LoopBack0ip address 10.0.1.1 255.255.255.0ospf network-type broadcast#ospf 1 router-id 1.1.1.1retransmission-limit 5flooding-control number 60area 0.0.0.0network 10.0.0.0 0.255.255.255user-interface vty 0 4authentication-mode aaaAR2配置:[AR2]dis current-configuration[V200R003C00]#sysname AR2#acl number 2000rule 5 permit source 10.0.4.0 0.0.0.255#interface GigabitEthernet0/0/0ip address 10.0.12.2 255.255.255.0#interface GigabitEthernet0/0/1ip address 10.0.23.2 255.255.255.0#interface LoopBack0ip address 10.0.2.2 255.255.255.0ospf network-type broadcastospf 1 router-id 2.2.2.2lsa-originate-interval intelligent-timer 6000 1000 1200 lsa-arrival-interval 1000retransmission-limitarea 0.0.0.0network 10.0.12.2 0.0.0.0area 0.0.0.1abr-summary 10.0.0.0 255.255.224.0network 10.0.2.2 0.0.0.0network 10.0.23.2 0.0.0.0AR3配置:[AR3]dis current-configuration[V200R003C00]sysname AR3interface GigabitEthernet0/0/0ip address 10.0.23.3 255.255.255.0 #interface LoopBack0ip address 10.0.3.3 255.255.255.0 ospf network-type broadcast#interface LoopBack1ip address 10.0.4.3 255.255.255.0 ospf network-type broadcast#interface LoopBack9ip address 99.1.1.1 255.255.255.0 #ospf 1 router-id 3.3.3.3import-route directarea 0.0.0.1network 10.0.0.0 0.255.255.255 nssa no-summary测试结果:注意:AR1与AR3连通性测试正常,如下图所示。
实验12:单区域上的OSPF配置(参考答案)
实验12:单区域上的OSPF配置(参考答案)实验12 单区域上的OSPF配置⼀、实验⽬的熟悉OSPF路由协议的特点与应⽤范围,掌握它的配置⽅法。
⼆、实验内容完成如下拓扑结构的单区域OSPF设计。
DTEDCEarea 0DCE DTE三、实验步骤1、⾸先按上图连接好路由器①选择2620路由器作为实验设备②添加接⼝并选择合适的端⼝进⾏互联2、按⽹络拓扑图规划IP 地址R1:loopback0 :1.1.1.1/24 s0:192.168.12.1/24R2:loopback0 :2.2.2.2/24 s0:192.168.12.2/24 s1:192.168.23.2/24 R3:loopback0 :3.3.3.3/24 s0:192.168.34.3/24s1:192.168.23.3/24 R4:loopback0 :4.4.4.4/24 s0:192.168.34.4/24备注:OSPF在运⾏过程中需要为⾃治系统(AS)内的路由器指定⼀个Router id 作为此路由器的唯⼀标识。
由于Router id是⼀个32位的⽆符号整数,这⼀点与IP地址⼗分相像。
⽽且IP地址是不会出现重复现象的,所以通常将路由器的Router id指定为与该设备上的某个接⼝的地址。
对于配置回环地址(loopback)的路由器,回环地址就成了Router id的最佳选择。
3、在各路由器上配置IP地址,保证链路的连通性如使⽤命令:R1(config)# int loopback0R1(config-if)#ip address 1.1.1.1 255.255.255.0R1(config)#int s0/0R1(config-if)#ip address 192.168.12.1 255.255.255.0R1(config-if)#no shutdown也可以像前⾯使⽤图形界⾯配置接⼝的IP地址。
同样道理同学们配置余下的三个路由器。
OSPF实验4OSPF多区域配置
OSPF实验四OSPF多区域配置
一、实验目的
配置OSPF的多区域并进行路由汇总。
应用场景:作为使用最为广泛的动态路由协议,OSPF的使用一般都要划分区域并在ABR上针对路由进行汇总。
二、实验设备
四台Cisco 7206 VXR 中由器、IOS版本V ersion 12.3(5)。
三、实验拓普
四、实验步骤
基本配置:
1、设备命名。
2、用Ping命令测试总部和分部链路的连通性。
3、按照拓扑图配置好接口IP和接口描述信息。
OSPF配置:
4、启动OSPF进程并配置Router-ID。
5、把相关接口放入OSPF进程并绑定特定的区域。
6、在ABR上做路由汇总。
五、配置命令
六、测试结果
七、实验思考
1、单区域OSPF能看到OSPF的路由是什么路由?在LSDB中能看到哪些LAS?多区
域?
2、OSPF划分区域的目的是什么?划分区域后什么配置是必须做的?为此在分配地址
时必须注意什么?
3、如何划分多区域?骨干区域的作用是什么?设计拓扑证明骨干区域的作用(有、无
骨干区域)?
4、针对区域间路由在哪个设备做汇总?路由汇总针对的是哪种LSA?
5、这种拓扑有什么问题?实际部署时如何解决?
6、不希望其他区域看到本区域的设备及链路IP,如何实现?
7、LSA1、LSA2、LSA3分别是哪个设备产生的?作用是什么?各自的关系是什么?查看LSA具体的内容?并尝试读解。
配置特殊的OSPF区域
三.配置NSSA OSPF NSSA功能是在RFC 3101中定义的, Cisco IOS11.2首次引入了这种功能。它是对末节 区域的一种非专用扩展,允许将有限的外部路由 注入到末节区域中。 将路由重分发到NSSA中时,将创建一种特殊的 LSA—7类LSA,这种LSA只能出现在NSSA中, 它是由NSSA ASBR生成的,而NSSA ABR将其 转换成5类LSA并在OSPF域中传播。 7类LSA的格式与5类LSA相同。
区域的类型决定了它将接收什么样的路由信息 一.配置末节区域 将区域配置为末节区域可缩小区域中的LSDB,从 而降低路由器的内存需求。另外,末节区域内的 路由器也无需频繁地执行SPF算法,因为它们收 到的路由更新较少。外部网络(5类)LSA不会扩散 到末节区域中。4类LSA也不会扩散到末节区域。 在这种区域中,使用默认路由0.0.0.0前往OSPF 自治系统的外部。
将区域配置成绝对末节NSSA步骤: 1.在区域内的所有路由器上配置OSPF 2.在区域内的所有路由器上配置路由器配置命令 area area-id nssa 而不是area area-id stub,从而 将区域配置为NSSA。 3.在ABR上,在命令area area-id nssa中添加关 键字no-summary 4.可选,在ABR上配置默认路由的开销。
配置特殊的OSPF区域
概述
OSPF基于两层的区域层次结构,其中包含 骨干区域和非骨干区域。每个区域都有自 己的拓扑数据库,该数据库在区域外面不 可见。属于多个区域的路由器(ABR)有多个 拓扑数据库—它连接的每个区域一个。所 有区域都必须与骨干区域直接相连或通过 虚链路连接到骨干区域。
实验2.4 OSPF Stub区域与NSSA区域
实验2.4 OSPF Stub区域与NSSA区域学习目的•掌握OSPF的Stub区域的配置•掌握OSPF的NSSA区域的配置•观察LSA Type7的内容•理解LSA Type7与Type5之间的转化关系拓扑图图1-4 OSPF Stub区域与NSSA区域场景你是公司的网络管理员。
现在公司的网络中有五台AR G3路由器,其中R2、R3和R4在公司总部。
R5在公司分部。
R5通过专线与公司总部的R3相连。
R1在公司的另外一个分部,通过专线与公司总部的R2相连。
网段10.0.23.0/24、10.0.2.0/24、10.0.3.0/24属于区域0。
网段10.0.35.0/24属于区域1,区域1为NSSA区域。
R5的Loopback0接口不属于OSPF区域。
网段10.0.24.0/24属于区域3。
R4的Loopback0接口连接到Internet,需要配置一条缺省路由。
网段10.0.12.0/24、10.0.1.0/24属于区域2,区域2为Stub区域。
同时为了明确设备的Router-ID,你配置设备使用固定的地址作为Router-ID。
学习任务步骤一.基础配置与IP编址给所有路由器配置IP地址和掩码。
配置时注意所有的Loopback接口配置掩码均为24位,模拟成一个单独的网段。
<R1>system-viewEnter system view, return user view with Ctrl+Z.[R1]interface Serial 1/0/0[R1-Serial1/0/0]ip address 10.0.12.1 24[R1-Serial1/0/0]quit[R1]interface LoopBack 0[R1-LoopBack0]ip address 10.0.1.1 24[R1-LoopBack0]quit<R2>system-viewEnter system view, return user view with Ctrl+Z.[R2]interface Serial 1/0/0[R2-Serial1/0/0]ip address 10.0.12.2 24[R2-Serial1/0/0]quit[R2]interface Serial 2/0/0[R2-Serial2/0/0]ip address 10.0.23.2 24[R2-Serial2/0/0]quit[R2]interface GigabitEthernet 0/0/0[R2-GigabitEthernet0/0/0]ip address 10.0.24.2 24[R2-GigabitEthernet0/0/0]quit[R2]interface LoopBack 0[R2-LoopBack0]ip address 10.0.2.2 24[R2-LoopBack0]quit<R3>system-viewEnter system view, return user view with Ctrl+Z.[R3]interface Serial 2/0/0[R3-Serial2/0/0]ip address 10.0.23.3 24[R3-Serial2/0/0]quit[R3]interface Serial 3/0/0[R3-Serial3/0/0]ip address 10.0.35.3 24[R3-Serial3/0/0]quit[R3]interface LoopBack 0[R3-LoopBack0]ip address 10.0.3.3 24[R3-LoopBack0]quit<R4>system-viewEnter system view, return user view with Ctrl+Z.[R4]interface GigabitEthernet 0/0/0[R4-GigabitEthernet0/0/0]ip address 10.0.24.4 24[R4-GigabitEthernet0/0/0]quit[R4]interface LoopBack 0[R4-LoopBack0]ip address 10.0.4.4 24[R4-LoopBack0]quit<R5>system-viewEnter system view, return user view with Ctrl+Z.[R5]interface Serial 1/0/0[R5-Serial1/0/0]ip address 10.0.35.5 24[R5-Serial1/0/0]quit[R5]interface LoopBack 0[R5-LoopBack0]ip address 10.0.5.5 24[R5-LoopBack0]quit测试直连链路的连通性。
OSPF的特殊区域讲解
OSPF实验7:OSPF特殊区域实验级别:Professional实验拓扑:实验说明:R2为ABR和ASBR,R3在NSSA实验时会成为ASBR。
在做这个实验之前,首先我们要了解一下OSPF LSA的类型。
见下表:在一个OSPF的普通区域,会存在LSA1,LSA2,LSA3,LSA4,LSA5这些LSA,并且数量很多。
我们可以通过OSPF的特殊区域的配置让某些区域减少LSA数目和路由表的条目。
基本配置:R1:interface Loopback0ip address 1.1.1.1 255.255.255.0ip ospf network point-to-point!interface Serial1/0ip address 10.1.1.1 255.255.255.0serial restart-delay 0!router ospf 10router-id 1.1.1.1log-adjacency-changesnetwork 1.1.1.0 0.0.0.255 area 0network 10.1.1.0 0.0.0.255 area 0R2:interface Loopback0ip address 2.2.2.2 255.255.255.0!interface Serial1/0ip address 10.1.1.2 255.255.255.0serial restart-delay 0!interface Serial1/1ip address 11.1.1.1 255.255.255.0serial restart-delay 0!router ospf 10router-id 2.2.2.2log-adjacency-changesredistribute connected subnetsnetwork 10.1.1.0 0.0.0.255 area 0network 11.1.1.0 0.0.0.255 area 1R3:interface Loopback0ip address 3.3.3.3 255.255.255.0!interface FastEthernet0/0no ip addressshutdownduplex half!interface Serial1/0ip address 11.1.1.2 255.255.255.0serial restart-delay 0!router ospf 10router-id 3.3.3.3log-adjacency-changesnetwork 11.1.1.0 0.0.0.255 area 1在R1和R3上查看路由表:R1#sho ip rouCodes: C - connected, S - static, R - RIP, M - mobile, B - BGPD - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter areaN1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2E1 - OSPF external type 1, E2 - OSPF external type 2i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2ia - IS-IS inter area, * - candidate default, U - per-user static routeo - ODR, P - periodic downloaded static routeGateway of last resort is not set1.0.0.0/24 is subnetted, 1 subnetsC 1.1.1.0 is directly connected, Loopback02.0.0.0/24 is subnetted, 1 subnetsO E2 2.2.2.0 [110/20] via 10.1.1.2, 00:03:00, Serial1/010.0.0.0/24 is subnetted, 1 subnetsC 10.1.1.0 is directly connected, Serial1/011.0.0.0/24 is subnetted, 1 subnetsO IA 11.1.1.0 [110/128] via 10.1.1.2, 00:03:00, Serial1/0R3#sho ip rouCodes: C - connected, S - static, R - RIP, M - mobile, B - BGPD - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter areaN1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2E1 - OSPF external type 1, E2 - OSPF external type 2i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2ia - IS-IS inter area, * - candidate default, U - per-user static routeo - ODR, P - periodic downloaded static routeGateway of last resort is not set1.0.0.0/24 is subnetted, 1 subnetsO IA 1.1.1.0 [110/129] via 11.1.1.1, 00:02:51, Serial1/02.0.0.0/24 is subnetted, 1 subnetsO E2 2.2.2.0 [110/20] via 11.1.1.1, 00:02:51, Serial1/03.0.0.0/24 is subnetted, 1 subnetsC 3.3.3.0 is directly connected, Loopback010.0.0.0/24 is subnetted, 1 subnetsO IA 10.1.1.0 [110/128] via 11.1.1.1, 00:02:51, Serial1/011.0.0.0/24 is subnetted, 1 subnetsC 11.1.1.0 is directly connected, Serial1/0OE2的路由是通过LSA5传播,OIA的路由是通过LSA3来传播。
实验一 ospf多区域配置
实验一OSPF多区域的配置一.实验目的1.掌握多区域的OSPF配置方法2.区别不同区域的路由3.掌握OSPF的基本配置命令二、实验拓扑图三、实验步骤及要求1.配置各台路由器的IP地址R1(config)#interface loopback 0R1(config-if)#ip address 10.1.1.1 255.255.255.0R1(config)#interface loopback 1R1(config-if)#ip address 10.1.2.1 255.255.255.0R1(config)#interface serial 2/0R1(config-if)#ip address 192.168.1.1 255.255.255.252 R1(config-if)#no shutdownRouter(config)#hostname r2r2(config)#interface serial 2/0r2(config-if)#ip address 192.168.1.2 255.255.255.252 r2(config-if)#clock rate 64000r2(config-if)#no shutdownr2(config-if)#exitr2(config)#interface serial 3/0r2(config-if)#ip address 192.168.1.5 255.255.255.252 r2(config-if)#clock rate 64000r2(config-if)#no shutdownr2(config-if)#exitRouter(config)#hostname r3r3(config)#interface serial 3/0r3(config-if)#ip address 192.168.1.6 255.255.255.252 r3(config-if)#exitr3(config)#interface serial 3/0r3(config-if)#no shutdownr3(config)#interface serial 2/0r3(config-if)#ip address 192.168.1.9 255.255.255.252r3(config-if)#clock rate 64000r3(config-if)#no shutdownRouter(config)#hostname r4r4(config)#interface serial 2/0r4(config-if)#ip address 192.168.1.10 255.255.255.252r4(config-if)#no shutdownr4(config-if)#exitr4(config)#interface loopback 0r4(config-if)#ip address 172.16.1.1 255.255.255.0r4(config-if)#exitr4(config)#interface loopback 1r4(config-if)#ip address 172.16.2.1 255.255.255.02.在r1上进行area1区域OSPF配置Router(config)#hostname r1r1(config)#router ospf 1r1(config-router)#network 10.1.2.0 0.0.0.255 area 1r1(config-router)#network 10.1.1.0 0.0.0.255 area 1r1(config-router)#network 192.168.1.0 0.0.0.3 area 1r1(config-router)#exit3.在r2上进行area1与area0的区域边界路由器(ABR)的OSPF配置r2(config)#router ospf 1r2(config-router)#network 192.168.1.0 0.0.0.3 area 1r2(config-router)#network 192.168.1.4 0.0.0.3 area 0r2(config-router)#exit4. 在r4上进行area2区域OSPF配置r4(config)#router ospf 1r4(config-router)#network 172.16.1.0 0.0.0.255 area 2r4(config-router)#network 172.16.2.0 0.0.0.255 area 2r4(config-router)#network 192.168.1.8 0.0.0.3 area 2r4(config-router)#exit在r3上进行area2与area0的区域边界路由器(ABR)的OSPF配置r3(config)#router ospf 1r3(config-router)#network 192.168.1.8 0.0.0.3 area 2r3(config-router)#network 192.168.1.4 0.0.0.3 area 0r3(config-router)#exit5. 在任一路由器上查看OSPF邻居表r2#show ip ospf neighborNeighbor ID Pri State Dead Time Address Interface 10.1.2.1 0 FULL/ - 00:00:38 192.168.1.1 Serial2/0 192.168.1.9 0 FULL/ - 00:00:39 192.168.1.6 Serial3/0R2路由器已经成功与r1和r3路由器建立邻居关系6.查看r1的路由表,观察其他区域的路由r1#show ip routeCodes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGPD - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter areaN1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGPi - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area* - candidate default, U - per-user static route, o - ODRP - periodic downloaded static routeGateway of last resort is not set10.0.0.0/24 is subnetted, 2 subnetsC 10.1.1.0 is directly connected, Loopback0C 10.1.2.0 is directly connected, Loopback1172.16.0.0/32 is subnetted, 2 subnetsO IA 172.16.1.1 [110/2344] via 192.168.1.2, 00:00:05, Serial2/0O IA 172.16.2.1 [110/2344] via 192.168.1.2, 00:00:05, Serial2/0192.168.1.0/30 is subnetted, 3 subnetsC 192.168.1.0 is directly connected, Serial2/0O IA 192.168.1.4 [110/1562] via 192.168.1.2, 00:00:05, Serial2/0O IA 192.168.1.8 [110/2343] via 192.168.1.2, 00:00:05, Serial2/07.查看r1的OSPF链路状态数据库r1#show ip ospf databaseOSPF Router with ID (10.1.2.1) (Process ID 1)Router Link States (Area 1)Link ID ADV Router Age Seq# Checksum Link count 10.1.2.1 10.1.2.1 310 0x80000007 0x00463f 4192.168.1.5 192.168.1.5 310 0x80000006 0x00164a 2Summary Net Link States (Area 1)Link ID ADV Router Age Seq# Checksum192.168.1.4 192.168.1.5 845 0x80000001 0x00fe75192.168.1.8 192.168.1.5 518 0x80000002 0x0072ec172.16.1.1 192.168.1.5 518 0x80000003 0x00fe0f8.在r1上使用ping命令确认路由的有效性r1#ping 172.16.1.1Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 172.16.1.1, timeout is 2 seconds:!!!!!Success rate is 100 percent (5/5), round-trip min/avg/max = 78/87/94 ms9.查看r4的路由表和ospf的链路状态数据库r4#show ip routeCodes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGPD - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter areaN1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGPi - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area* - candidate default, U - per-user static route, o - ODRP - periodic downloaded static routeGateway of last resort is not set10.0.0.0/32 is subnetted, 2 subnetsO IA 10.1.1.1 [110/2344] via 192.168.1.9, 00:23:31, Serial2/0O IA 10.1.2.1 [110/2344] via 192.168.1.9, 00:23:31, Serial2/0172.16.0.0/24 is subnetted, 2 subnetsC 172.16.1.0 is directly connected, Loopback0C 172.16.2.0 is directly connected, Loopback1192.168.1.0/30 is subnetted, 3 subnetsO IA 192.168.1.0 [110/2343] via 192.168.1.9, 00:23:41, Serial2/0O IA 192.168.1.4 [110/1562] via 192.168.1.9, 00:27:24, Serial2/0C 192.168.1.8 is directly connected, Serial2/0r4#show ip ospf databaseOSPF Router with ID (172.16.2.1) (Process ID 1)Router Link States (Area 2)Link ID ADV Router Age Seq# Checksum Link count 172.16.2.1 172.16.2.1 34 0x80000005 0x00feff 4192.168.1.9 192.168.1.9 14 0x80000004 0x00feff 2Summary Net Link States (Area 2)Link ID ADV Router Age Seq# Checksum192.168.1.0 192.168.1.9 1590 0x80000005 0x00a4bb10.1.1.1 192.168.1.9 1580 0x80000007 0x00d5e1 192.168.1.4 192.168.1.9 9 0x80000008 0x00f206。
OSPFLSA的7种类型及特殊区域和路由表详解
OSPFLSA的7种类型及特殊区域和路由表详解始发路由器内容泛洪区域Link State ID 在OSPF数据库中的名字1 RouterLSA每台路由器链路或接⼝type和cost本区域始发路由器的router-idRouter Link States2 NetworkLSAMA⽹络中DR产⽣与之相连的路由器的router-id (包括DR)本区域DR接⼝上的IP地址Net Link States3 NetworkSummaryLSAABR区域外部的⽬的地址(到同⼀⽬的中cost最⼩的)及到该⽬的的cost跨区域Internal⽹络Summary NetLink States4ASBRSummaryLSAASBRASBR路由器及到该路由器的cost跨区域所通告的ASBR路由器的router-id Summary ASB Link States5ASExternalLSAASBRAS外部的⽬的地址及其costAS External⽹络Type-5 AS External Link States7NSSAExternalLSANSSA中的ASBRAS外部的⽬的地址及其costNSSA External⽹络Type-7 AS External Link StatesStub area末梢区域(存根区域)没有4类和5类LSA,ABR下发⼀条3类0.0.0.0/0默认路由O *IA配置命令:所有stub区域路由器上router ospf 1area 1 stubTotally stub area没有3、4、5类LSA,ABR下发⼀条3类0.0.0.0/0默认路由O* IA配置命令:区域内部路由器:router ospf 1area 1 stubABR路由器:router ospf 1area 1 stub no-summary //阻挡3类外部汇总路由area 1 default-cost 10 // 设定下发默认路由的cost值Not-so-stubby-area(NSSA)⾮完全末梢区域:既想阻挡LSA5,⼜想引⼊外部路由没有4、5类LSA,外部路由注⼊NSSA区域⾥,ASBR产⽣7类LSA,7类LSA只能存在于NSSA区域⾥,若穿越ABR到其他区域ABR会将其变成5类LSA,NSSA区域的ABR不会下发3类0.0.0.0/0默认路由,可⼿⼯配置配置命令:所有NSSA区域路由器上配置,如果某路由器没有配置,它将不能与其他NSSA路由器建⽴邻居关系。
第24章-OSPF路由协议配置实训
//特权模式提醒符
Router1#config terminal
//进入全局配置模式
Router1(config)#
//全局配置模式提醒符
Router1(config)# router ospf 100 //开启OSPF协议,其进程号为100
Router1(config-router)#network 192.1.0.128 0.0.0.63 area 1 //指定与Router1相
链路(Link)就是路由器上旳接口,指运营在OSPF进程下 旳接口。 链路状态(LSA)是一种参数,一般带宽、时延、费用等 都可做状态参数。就是OSPF接口上旳描述信息,例如接口上 旳IP地址,子网掩码,网络类型,Cost值等等,OSPF路由器 之间互换旳并不是路由表,而是链路状态(LSA),OSPF经过 取得网络中全部旳链路状态信息,从而计算出到达每个目旳精 确旳网络途径。 链路开销cost是主要考虑链路状态旳一种参数。
router ospf process-id1
指定与该路由器 network address wildcard-mask area area-id2 相连旳网络
OSPF协议旳配置命令解析: 1、OSPF路由进程process-id必须指定范围在1-65535,多种OSPF进程 能够在同一种路由器上配置,但最佳不这么做。多种OSPF进程需要多种 OSPF数据库旳副本,必须运营多种最短途径算法旳副本。process-id只 在路由器内部起作用,不同路由器旳process-id能够不同。
连旳网络为,此端口加入区域1
Router1(config-router)#ctrl+z
//直接返回到特权模式
2.在路由器Router2上配置OSPF,配置过程如下:
华为ospf多区域配置
OSPF多区域配置1.规划网络拓扑图如下:文字说明:a.R1 与 R2 作为末梢区域area 1b.R2 与 R3 作为主区域area 0c.R3 与 R4 作为末梢区域area 2d.R1 上连接交换机LSW3,LSW3上拥有vlan 8,g0/0/1与g/0/2属于vlan 8e.R1还直连一个主机,网段为192.168.7.0 网段。
2.配置:R1:<Huawei>sysEnter system view, return user view with Ctrl+Z.[Huawei]un in enInfo: Information center is disabled.[Huawei]sysname R1[R1]int e0/0/0[R1-Ethernet0/0/0]ip add 12.1.1.1 30[R1-Ethernet0/0/0]q[R1]int e0/0/1[R1-Ethernet0/0/1]ip add 192.168.8.1 24[R1-Ethernet0/0/1]q[R1]int g0/0/0[R1-GigabitEthernet0/0/0]ip add 192.168.7.1 24[R1-GigabitEthernet0/0/0]q[R1]int loop[R1]int LoopBack 0[R1-LoopBack0]ip add 1.1.1.1 24[R1-LoopBack0]q[R1]int loopback 1[R1-LoopBack1]ip add 192.168.1.1 24[R1-LoopBack1]q[R1]ospf 10[R1-ospf-10]area 1[R1-ospf-10-area-0.0.0.1]network 192.168.8.0 0.0.0.255 //为了能让网段能够到达[R1-ospf-10-area-0.0.0.1]network 192.168.7.0 0.0.0.255 //为了能让网段能够到达[R1-ospf-10-area-0.0.0.1]q[R1-ospf-10]q[R1]R2:[R2]int e0/0/0[R2-Ethernet0/0/0]ip add 12.1.1.2 30[R2-Ethernet0/0/0]int e0/0/1[R2-Ethernet0/0/1]ip add 23.1.1.1 30 [R2-Ethernet0/0/1]q[R2]int loopback 0[R2-LoopBack0]ip add 2.2.2.2 24[R2-LoopBack0]q[R2]int loopback 1[R2-LoopBack1]ip add 192.168.2.1 24 [R2-LoopBack1]q[R2]ospf 10[R2-ospf-10]area 1[R2-ospf-10-area-0.0.0.1]q[R2-ospf-10]area 0[R2-ospf-10-area-0.0.0.0]q[R2-ospf-10]q[R2]R3:[Huawei]sysname R3[R3]int e0/0/0[R3-Ethernet0/0/0]ip add 34.1.1.1 30 [R3-Ethernet0/0/0]int e0/0/1[R3-Ethernet0/0/1]ip add 23.1.1.2 30 [R3-Ethernet0/0/1]q[R3]int loopback 0[R3-LoopBack0]ip add 3.3.3.3 24[R3-LoopBack0]q[R3]int loopback 1[R3-LoopBack1]ip add 192.168.3.1 24 [R3-LoopBack1]q[R3]ospf 10[R3-ospf-10]area 2[R3-ospf-10-area-0.0.0.2]q[R3-ospf-10]area 0[R3-ospf-10-area-0.0.0.0]q[R3-ospf-10]q[R3]R4:[Huawei]sysname R4[R4]int e0/0/0[R4-Ethernet0/0/0]ip add 34.1.1.2 30 [R4-Ethernet0/0/0]q[R4]int loopback 0[R4-LoopBack0]ip add 4.4.4.4 24[R4-LoopBack0]q[R4]int loopback 1[R4-LoopBack1]ip add 192.168.4.1 24[R4-LoopBack1]q[R4]ospf 10[R4-ospf-10]area 2[R4-ospf-10-area-0.0.0.2]q[R4-ospf-10]q[R4]从PC端ping各个路由器的route idPing 1.1.1.1: 32 data bytes, Press Ctrl_C to break From 1.1.1.1: bytes=32 seq=1 ttl=255 time=31 ms From 1.1.1.1: bytes=32 seq=2 ttl=255 time=15 ms From 1.1.1.1: bytes=32 seq=3 ttl=255 time=16 ms From 1.1.1.1: bytes=32 seq=4 ttl=255 time=31 ms From 1.1.1.1: bytes=32 seq=5 ttl=255 time=16 ms--- 1.1.1.1 ping statistics ---5 packet(s) transmitted5 packet(s) received0.00% packet lossround-trip min/avg/ma* = 15/21/31 msPing 3.3.3.3: 32 data bytes, Press Ctrl_C to break From 3.3.3.3: bytes=32 seq=1 ttl=253 time=94 ms From 3.3.3.3: bytes=32 seq=2 ttl=253 time=109 ms From 3.3.3.3: bytes=32 seq=3 ttl=253 time=94 ms From 3.3.3.3: bytes=32 seq=4 ttl=253 time=94 ms From 3.3.3.3: bytes=32 seq=5 ttl=253 time=94 ms--- 3.3.3.3 ping statistics ---5 packet(s) transmitted5 packet(s) received0.00% packet lossround-trip min/avg/ma* = 94/97/109 msPing 4.4.4.4: 32 data bytes, Press Ctrl_C to break From 4.4.4.4: bytes=32 seq=1 ttl=252 time=156 ms From 4.4.4.4: bytes=32 seq=2 ttl=252 time=125 ms From 4.4.4.4: bytes=32 seq=3 ttl=252 time=109 ms From 4.4.4.4: bytes=32 seq=4 ttl=252 time=110 ms From 4.4.4.4: bytes=32 seq=5 ttl=252 time=141 ms --- 4.4.4.4 ping statistics ---5 packet(s) transmitted5 packet(s) received0.00% packet lossround-trip min/avg/ma* = 109/128/156 msPC>查看R2的路由表:3.配置R1与R2 链路认证,使用明文认证R1:[R1]int e0/0/0[R1-Ethernet0/0/0]ospf aut[R1-Ethernet0/0/0]ospf authentication-mode sim[R1-Ethernet0/0/0]ospf authentication-mode simple plain YP[R1-Ethernet0/0/0]q查看邻居路由:两个路由器链路密码不同断开认证邻居关系[R1]dis ospf peer briefPeer Statistic Information----------------------------------------------------------------------------Area Id Interface Neighbor id State0.0.0.1 Ethernet0/0/0 12.1.1.2Full----------------------------------------------------------------------------R2:[R2]int e0/0/0[R2-Ethernet0/0/0]ospf au[R2-Ethernet0/0/0]ospf authentication-mode simple plain YP[R2-Ethernet0/0/0]q查看邻居路由:两个路由器链路密码一样重新连接认证邻居关系[R2]dis ospf peer briefPeer Statistic Information----------------------------------------------------------------------------Area Id Interface Neighbor id State0.0.0.0 Ethernet0/0/1 34.1.1.1Full0.0.0.1 Ethernet0/0/0 12.1.1.1Full----------------------------------------------------------------------------4.配置R3与R4的区域认证,使用密文认证。
ospf四个区域内可泛洪的lsa教程文件
o s p f四个区域内可泛洪的l s aOSPF里几个特殊区域(stub、Totally stubby、NSSA、Totally NSSA)总结(2012-02-16 01:12:44)转载▼分类:IT标签:it首先,不管什么stub,其区域内所有router都要设成对应stub,否则邻居down,因为配置为末节区域的路由器上所有接口发出的Hello包中都会有末节标签。
对于所有的末节区域,ABR总是过滤掉5类LSA。
绝对末节区域和绝对NSSA里ABR还将3类LSA过滤掉。
普通末节区域和NSSA会正常通行3类LSA。
区域间路由汇总必须在ABR上完成Area 1 range 1.1.4.0 255.255.252.0外部路由汇总必须在ASBR上完成Summary-address 4.4.0.0 255.255.252.0Router LSA 1类路由LSA show ip ospf database routerNetwork LSA 2类网络LSA show ip ospf database networkNetwork Summary LSA 3类网络汇总LSA show ip ospf database summaryASBR Summary LSA 4类ASBR汇总LSA show ip ospf database asbr-summaryAS External LSA 5类AS外部LSA show ip ospf database externalGroup Membership LSA 6类组成员LSANSSA External LSA 7类NSSA外部LSA show ip ospf database nssa-externalExternal Attributes LSA 8类外部属性LSA9 10 11 Opaque LSAstub area:命令:area area-id stub特点:过滤外部路由,不接受外部AS的LSA(即5类LSA),3类LSA正常通行ABR上可设默认度量值:area area-id default-metric metric默认值为1.只有一个出口,无虚链路经过,不是主干区域,无ASBR(except that the ABRs may also be ASBRs),最好只有一个ABR,多个ABR可能导致次优路由。
OSPF--NAAS
CCIE学习笔记——OSPF_NSSAEditor:EdisonE-mail:shilianwang@QQ:21478604如有疏漏之处请不吝赐教如有转载请注明作者及出处这次介绍OSPF的一个特殊区域—NSSA,所用拓扑来自IEWB,关于基础配置,不再重复说明,可以参照"CCIE学习笔记——OSPF Filterring"的Common Multi-Area Configuration with 2 ABRs实验.实验一.NSSA Area Type 7to5 LSA Translator ElectionObjective: Influence OSPF NSSA Type 7 to Type 5 translating router electionDirections:Configure routers as per the OSPF scenario “Common Multi-AreaConfiguration with 2 ABRs”Configure Area 1 as NSSA on R1, R4 and R6Add a static route 160.X.60.0/24 to Null0 on R6 and redistribute it intoOSPFConfigure R1 to have higher router-id than R4, so that it may becomedesignated NSSA Area 7->5 translatorFinal ConfigurationR1,R4,R6:router ospf 1area 1 nssa----OSPF进程下,配置NSSA区域,所有在该区域的路由器均要配置,否则邻居不能建立R6:ip route 160.1.60.0 255.255.255.0 Null0----建立一条静态路由,指向null0接口,模拟外部路由router ospf 1redistribute static subnetsR1:router ospf 1router-id 150.1.100.100----将R1的router-id设定的比R4大,目的是让R1成为7类LSA->5类LSA的转换路由器.VerificationBefore:R1#show ip route ospf160.1.0.0/24 is subnetted, 1 subnetsO E2 160.1.60.0 [110/20] via 155.1.146.6, 00:00:41, FastEthernet0/0―――R1显示为E2,说明此时R1并不是7类->5类的转换路由器150.1.0.0/16 is variably subnetted, 4 subnets, 2 masksO 150.1.6.6/32 [110/2] via 155.1.146.6, 00:00:41, FastEthernet0/0O 150.1.5.5/32 [110/65] via 155.1.0.5, 00:01:24, Serial0/0O 150.1.4.4/32 [110/2] via 155.1.146.4, 00:00:41, FastEthernet0/0R4#show ip route ospf160.1.0.0/24 is subnetted, 1 subnetsO N2 160.1.60.0 [110/20] via 155.1.146.6, 00:01:10, Ethernet0/1―――R4显示为N2,说明此时R4是7类->5类的转换路由器150.1.0.0/16 is variably subnetted, 4 subnets, 2 masksO 150.1.6.6/32 [110/11] via 155.1.146.6, 00:01:10, Ethernet0/1O 150.1.5.5/32 [110/391] via 155.1.0.5, 00:01:25, Serial0/0O 150.1.1.1/32 [110/11] via 155.1.146.1, 00:01:10, Ethernet0/1R5#show ip route ospf155.1.0.0/24 is subnetted, 3 subnetsO IA 155.1.146.0 [110/391] via 155.1.0.1, 00:01:28, Serial0/0160.1.0.0/24 is subnetted, 1 subnetsO E2 160.1.60.0 [110/20] via 155.1.0.1, 00:02:06, Serial0/0150.1.0.0/16 is variably subnetted, 5 subnets, 2 masksO IA 150.1.6.6/32 [110/392] via 155.1.0.1, 00:01:42, Serial0/0O IA 150.1.4.4/32 [110/391] via 155.1.0.4, 00:04:42, Serial0/0O IA 150.1.1.1/32 [110/391] via 155.1.0.1, 00:04:36, Serial0/0R5#show ip ospf database external 160.1.60.0OSPF Router with ID (150.1.5.5) (Process ID 1)Type-5 AS External Link StatesRouting Bit Set on this LSALS age: 226Options: (No TOS-capability, DC)LS Type: AS External LinkLink State ID: 160.1.60.0 (External Network Number )Advertising Router: 150.1.4.4―――通过R4学到的外部E2路由LS Seq Number: 80000001Checksum: 0xBCC2Length: 36Network Mask: /24Metric Type: 2 (Larger than any link state path)TOS: 0Metric: 20Forward Address: 150.1.6.6External Route Tag: 0R1#show ip ospf database external 160.1.60.0OSPF Router with ID (150.1.1.1) (Process ID 1)Type-5 AS External Link StatesRouting Bit Set on this LSALS age: 321Options: (No TOS-capability, DC)LS Type: AS External LinkLink State ID: 160.1.60.0 (External Network Number )Advertising Router: 150.1.4.4LS Seq Number: 80000001Checksum: 0xBCC2Length: 36Network Mask: /24Metric Type: 2 (Larger than any link state path)TOS: 0Metric: 20Forward Address: 150.1.6.6External Route Tag: 0R4#show ip ospf database nssa-external 160.1.60.0OSPF Router with ID (150.1.4.4) (Process ID 1)Type-7 AS External Link States (Area 1)Routing Bit Set on this LSALS age: 376Options: (No TOS-capability, Type 7/5 translation, DC)―――可以看出R4此时为转换路由器LS Type: AS External LinkLink State ID: 160.1.60.0 (External Network Number )Advertising Router: 150.1.6.6LS Seq Number: 80000001Checksum: 0xE63Length: 36Network Mask: /24Metric Type: 2 (Larger than any link state path)TOS: 0Metric: 20Forward Address: 150.1.6.6External Route Tag: 0After:R1#conf tEnter configuration commands, one per line. End with CNTL/Z.R1(config)#router ospf 1R1(config-router)#router-id 150.1.100.100Reload or use "clear ip ospf process" command, for this to take effectR1(config-router)#^ZR1#clear ip ospf processReset ALL OSPF processes? [no]: yesR1#show ip route ospf160.1.0.0/24 is subnetted, 1 subnetsO N2 160.1.60.0 [110/20] via 155.1.146.6, 00:00:01, FastEthernet0/0―――已经可以看出,R1已经变为7类->5类转换路由器150.1.0.0/16 is variably subnetted, 4 subnets, 2 masksO 150.1.6.6/32 [110/2] via 155.1.146.6, 00:00:30, FastEthernet0/0O 150.1.5.5/32 [110/65] via 155.1.0.5, 00:00:01, Serial0/0O 150.1.4.4/32 [110/2] via 155.1.146.4, 00:00:30, FastEthernet0/0R4#show ip route ospf160.1.0.0/24 is subnetted, 1 subnetsO E2 160.1.60.0 [110/20] via 155.1.146.6, 00:00:08, Ethernet0/1150.1.0.0/16 is variably subnetted, 4 subnets, 2 masksO 150.1.6.6/32 [110/11] via 155.1.146.6, 00:00:27, Ethernet0/1O 150.1.5.5/32 [110/391] via 155.1.0.5, 00:00:08, Serial0/0O 150.1.1.1/32 [110/11] via 155.1.146.1, 00:00:27, Ethernet0/1R5#show ip route ospf155.1.0.0/24 is subnetted, 3 subnetsO IA 155.1.146.0 [110/391] via 155.1.0.1, 00:00:17, Serial0/0160.1.0.0/24 is subnetted, 1 subnetsO E2 160.1.60.0 [110/20] via 155.1.0.1, 00:00:17, Serial0/0150.1.0.0/16 is variably subnetted, 5 subnets, 2 masksO IA 150.1.6.6/32 [110/392] via 155.1.0.1, 00:00:17, Serial0/0O IA 150.1.4.4/32 [110/391] via 155.1.0.4, 00:00:17, Serial0/0O IA 150.1.1.1/32 [110/391] via 155.1.0.1, 00:00:17, Serial0/0R5#show ip ospf database external 160.1.60.0OSPF Router with ID (150.1.5.5) (Process ID 1)Type-5 AS External Link StatesRouting Bit Set on this LSALS age: 45Options: (No TOS-capability, DC)LS Type: AS External LinkLink State ID: 160.1.60.0 (External Network Number )Advertising Router: 150.1.100.100―――从R1学到5类LSA,说明7类到5类的转换是R1所为.LS Seq Number: 80000001Checksum: 0xD7E6Length: 36Network Mask: /24Metric Type: 2 (Larger than any link state path)TOS: 0Metric: 20Forward Address: 150.1.6.6External Route Tag: 0注:另外,通过sh ip os da也可以查看此路由器是否为7类->5类转换路由器实验二.NSSA Area ABR External Prefix FilteringObjective: Configure NSSA ABR to filter external prefixes originated at ASBRDirections:Configure routers as per the OSPF scenario “NSSA Area Type 7to5 LSATranslator Election”Configure summary address 160.X.6.0/24 on R1 (NSSA translator) withkeyword “not-advertise”This way you prevent new Type 5 LSA, translated from Type 7 from beingpropagatedFinal ConfigurationR1:router ospf 1summary-address 160.1.6.0 255.255.255.0 not-advertise―――此命令用来产生一条7类LSA,若后面加上not-advertise则表示它不会被NSSAABR转换为一个5类LSA.VerificationBefore summary has been configured:R5#show ip route ospf155.1.0.0/24 is subnetted, 3 subnetsO IA 155.1.146.0 [110/391] via 155.1.0.1, 00:33:31, Serial0/0160.1.0.0/24 is subnetted, 1 subnetsO E2 160.1.60.0 [110/20] via 155.1.0.1, 00:33:31, Serial0/0―――起初是可以学到160.1.60.0的路由,并标识为5类.150.1.0.0/16 is variably subnetted, 5 subnets, 2 masksO IA 150.1.6.6/32 [110/392] via 155.1.0.1, 00:33:31, Serial0/0O IA 150.1.4.4/32 [110/391] via 155.1.0.4, 00:33:31, Serial0/0O IA 150.1.1.1/32 [110/391] via 155.1.0.1, 00:33:31, Serial0/0R4#show ip route ospf160.1.0.0/24 is subnetted, 1 subnetsO E2 160.1.60.0 [110/20] via 155.1.146.6, 00:00:09, Ethernet0/1150.1.0.0/16 is variably subnetted, 4 subnets, 2 masksO 150.1.6.6/32 [110/11] via 155.1.146.6, 00:37:30, Ethernet0/1O 150.1.5.5/32 [110/391] via 155.1.0.5, 00:37:11, Serial0/0O 150.1.1.1/32 [110/11] via 155.1.146.1, 00:37:30, Ethernet0/1After:R5#show ip route ospf155.1.0.0/24 is subnetted, 3 subnetsO IA 155.1.146.0 [110/391] via 155.1.0.1, 00:34:04, Serial0/0150.1.0.0/16 is variably subnetted, 5 subnets, 2 masksO IA 150.1.6.6/32 [110/392] via 155.1.0.1, 00:34:04, Serial0/0O IA 150.1.4.4/32 [110/391] via 155.1.0.4, 00:34:04, Serial0/0O IA 150.1.1.1/32 [110/391] via 155.1.0.1, 00:34:04, Serial0/0―――现在R5的路由表里已经没有了关于160.1.60.0的5类LSA,虽然前面说过,summary address 160.1.60.0 255.255.255.0 not-advertise并不会抑制7类LSA,但是要注意的是7类LSA只会在NSSA区域传播,而R5所处的区域为area 0,所以不会出现关于160.1.60.0的7类LSA.R1#show ip route ospf160.1.0.0/24 is subnetted, 1 subnetsO N2 160.1.60.0 [110/20] via 155.1.146.6, 00:34:38, FastEthernet0/0150.1.0.0/16 is variably subnetted, 4 subnets, 2 masksO 150.1.6.6/32 [110/2] via 155.1.146.6, 00:35:07, FastEthernet0/0O 150.1.5.5/32 [110/65] via 155.1.0.5, 00:34:38, Serial0/0O 150.1.4.4/32 [110/2] via 155.1.146.4, 00:35:07, FastEthernet0/0R4#show ip route ospf160.1.0.0/24 is subnetted, 1 subnetsO N2 160.1.60.0 [110/20] via 155.1.146.6, 00:01:00, Ethernet0/1150.1.0.0/16 is variably subnetted, 4 subnets, 2 masksO 150.1.6.6/32 [110/11] via 155.1.146.6, 00:35:13, Ethernet0/1O 150.1.5.5/32 [110/391] via 155.1.0.5, 00:34:53, Serial0/0O 150.1.1.1/32 [110/11] via 155.1.146.1, 00:35:13, Ethernet0/1―――因为抑制了5类LSA,所以此时R1和R4的路由表里只有关于160.1.60.0的7类LSAR4#show ip ospf database nssa-external 160.1.60.0OSPF Router with ID (150.1.4.4) (Process ID 1)Type-7 AS External Link States (Area 1)Routing Bit Set on this LSALS age: 877Options: (No TOS-capability, Type 7/5 translation, DC)LS Type: AS External LinkLink State ID: 160.1.60.0 (External Network Number )Advertising Router: 150.1.6.6―――表示已经收不到来自R1的关于160.1.60.0的5类LSA了,只能收到来自R6的7类LSA.LS Seq Number: 80000002Checksum: 0xC64Length: 36Network Mask: /24Metric Type: 2 (Larger than any link state path)TOS: 0Metric: 20Forward Address: 150.1.6.6External Route Tag: 0注释:经常会有人将实验二的命令同area x nssa no-redistribution混淆.Summary-address x not-advertise的意思是不将x由类型7转换成类型5;而area x nssa no-redistribution 的意思是不将外部路由作为类型7引入NSSA,这种情况通常发生在一个router即是ASBR又是NSSA ABR的时候.实验三.NSSA Suppress FA FeatureObjective: Configure NSSA FA-suppress feature to resolve connectivity problemDirections:Configure routers as per the OSPF scenario “NSSA Area Type 7to5 LSATranslator Election”Configure routers as per scenario “OSPF Type-3 LSA Filtering withNetwork Ranges”Configure NSSA Suppress FA feature on NSSA 7->5 Translating router inorder to change FA of translated prefixesFinal ConfigurationR1:router ospf 1area 1 nssa translate type7 suppress-fa―――此条命令只在7类->5类的ABR上配置.VerificationBefore Suppress-FA feature has been enabled:R5#show ip route ospf155.1.0.0/24 is subnetted, 3 subnetsO IA 155.1.146.0 [110/391] via 155.1.0.1, 00:03:43, Serial0/0150.1.0.0/16 is variably subnetted, 4 subnets, 2 masksO IA 150.1.4.4/32 [110/391] via 155.1.0.4, 00:03:43, Serial0/0O IA 150.1.1.1/32 [110/391] via 155.1.0.1, 00:03:43, Serial0/0R5#show ip os data extOSPF Router with ID (150.1.5.5) (Process ID 1)Type-5 AS External Link StatesLS age: 235Options: (No TOS-capability, DC)LS Type: AS External LinkLink State ID: 160.1.60.0 (External Network Number )Advertising Router: 150.1.100.100LS Seq Number: 80000001Checksum: 0xD7E6Length: 36Network Mask: /24Metric Type: 2 (Larger than any link state path)TOS: 0Metric: 20Forward Address: 150.1.6.6External Route Tag: 0R5#show ip route 150.1.6.6% Subnet not in tableAfter that:R5#show ip route ospf155.1.0.0/24 is subnetted, 3 subnetsO IA 155.1.146.0 [110/391] via 155.1.0.1, 00:05:26, Serial0/0160.1.0.0/24 is subnetted, 1 subnetsO E2 160.1.60.0 [110/20] via 155.1.0.1, 00:00:04, Serial0/0150.1.0.0/16 is variably subnetted, 4 subnets, 2 masksO IA 150.1.4.4/32 [110/391] via 155.1.0.4, 00:05:25, Serial0/0O IA 150.1.1.1/32 [110/391] via 155.1.0.1, 00:05:26, Serial0/0R5#show ip ospf data exOSPF Router with ID (150.1.5.5) (Process ID 1)Type-5 AS External Link StatesRouting Bit Set on this LSALS age: 13Options: (No TOS-capability, DC)LS Type: AS External LinkLink State ID: 160.1.60.0 (External Network Number )Advertising Router: 150.1.100.100LS Seq Number: 80000002Checksum: 0xAEB2Length: 36Network Mask: /24Metric Type: 2 (Larger than any link state path)TOS: 0Metric: 20Forward Address: 0.0.0.0External Route Tag: 0注:关于OSPF的NSSA Suppress FA Feature,我只知道它的作用是让ABR在将LSA7转换成LSA5的时候用0.0.0.0覆盖原有数据,具体什么时候需要这样配置,我也不太清楚,大家有兴趣的话,可以自己研究,如果明白了怎么回事,别忘了告诉我啊~~下面是官方解释:The OSPF Forwarding Address Suppression in Translated Type-5 LSAs feature causes an NSSA ABR to translate Type-7 LSAs to Type-5 LSAs, but use the 0.0.0.0 as the forwarding address instead of that specified in the Type-7 LSA. This feature causes routers that are configured not to advertise forwarding addresses into the backbone to direct forwarded traffic to the translating NSSA ASBRs.下面介绍两种在NSSA ABR上产生默认路由的实验实验四.NSSA Area and Default-Route Origiantion at ABR Part 1Objective: Configure NSSA ABRs to advertise default-route as Type-3 LSA. Donot assign the default cost to this route.Directions:Configure routers as per the OSPF scenario “NSSA Area Type 7to5 LSATranslator Election”Configure R1 and R4 as “no-summary” NSSA ABRsConfigure R1 and R4 to send default route with the cost of 100Final ConfigurationR1 & R4:router ospf 1area 1 nssa no-summary―――只需要在ABR上配置,将区域1变成绝对末节NSSAarea 1 default-cost 100VerificationBefore:R6#show ip route ospf155.1.0.0/24 is subnetted, 2 subnetsO IA 155.1.0.0 [110/65] via 155.1.146.1, 00:46:49, GigabitEthernet0/1 150.1.0.0/16 is variably subnetted, 4 subnets, 2 masksO IA 150.1.5.5/32 [110/66] via 155.1.146.1, 00:00:15, GigabitEthernet0/1 O 150.1.4.4/32 [110/2] via 155.1.146.4, 00:46:49, GigabitEthernet0/1O 150.1.1.1/32 [110/2] via 155.1.146.1, 00:46:49, GigabitEthernet0/1 After:R6#show ip route ospf150.1.0.0/16 is variably subnetted, 3 subnets, 2 masksO 150.1.4.4/32 [110/2] via 155.1.146.4, 00:50:26, GigabitEthernet0/1O 150.1.1.1/32 [110/2] via 155.1.146.1, 00:50:26, GigabitEthernet0/1O*IA 0.0.0.0/0 [110/101] via 155.1.146.4, 00:00:02, GigabitEthernet0/1 [110/101] via 155.1.146.1, 00:00:02, GigabitEthernet0/1 -――已经学不到区域间路由,而是有ABR产生一条默认汇总路由进入NSSA区域.Tear down R1’s Link to Area0:R1#conf tEnter configuration commands, one per line. End with CNTL/Z.R1(config)#inter se 0/0R1(config-if)#shutR1(config-if)#%OSPF-5-ADJCHG: Process 1, Nbr 150.1.5.5 on Serial0/0 from FULL to DOWN, Neighbor Down: Interface down or detachedR6#show ip route ospf150.1.0.0/16 is variably subnetted, 3 subnets, 2 masksO 150.1.4.4/32 [110/2] via 155.1.146.4, 00:00:48, GigabitEthernet0/1O 150.1.1.1/32 [110/2] via 155.1.146.1, 00:00:48, GigabitEthernet0/1O*IA 0.0.0.0/0 [110/101] via 155.1.146.4, 00:00:48, GigabitEthernet0/1实验五.NSSA Area and Default-Route Origiantion at ABR Part 2Objective: Configure NSSA ABRs to advertise default-route as Type-7 LSA. Donot assign the default metric to this routeDirections:Configure routers as per the OSPF scenario “NSSA Area Type 7to5 LSATranslator Election”Configure Area 1 on R1 and R4 as NSSA with “default-informationoriginate”keywordConfigure R1 and R4 to send this default route with the metric of 100Final ConfigurationR1 & R4:router ospf 1area 1 nssa default-information-originate metric 100―――为区域1产生类型7的默认路由.VerificationBefore default origination has been configured:R6#show ip route ospf155.1.0.0/24 is subnetted, 2 subnetsO IA 155.1.0.0 [110/65] via 155.1.146.1, 00:46:49, GigabitEthernet0/1150.1.0.0/16 is variably subnetted, 4 subnets, 2 masksO IA 150.1.5.5/32 [110/66] via 155.1.146.1, 00:00:15, GigabitEthernet0/1O 150.1.4.4/32 [110/2] via 155.1.146.4, 00:46:49, GigabitEthernet0/1O 150.1.1.1/32 [110/2] via 155.1.146.1, 00:46:49, GigabitEthernet0/1After:R6#show ip route ospf155.1.0.0/24 is subnetted, 2 subnetsO IA 155.1.0.0 [110/65] via 155.1.146.1, 00:00:33, GigabitEthernet0/1 150.1.0.0/16 is variably subnetted, 4 subnets, 2 masksO IA 150.1.5.5/32 [110/66] via 155.1.146.1, 00:00:33, GigabitEthernet0/1O 150.1.4.4/32 [110/2] via 155.1.146.4, 00:03:01, GigabitEthernet0/1O 150.1.1.1/32 [110/2] via 155.1.146.1, 00:03:01, GigabitEthernet0/1O*N2 0.0.0.0/0 [110/100] via 155.1.146.4, 00:00:03, GigabitEthernet0/1[110/100] via 155.1.146.1, 00:00:03, GigabitEthernet0/1―――路由表中显示区域间路由仍然存在,并且产生了一条N2(7类)的默认路由.注释:该条命令可以在NSSA ABR和NSSA ASBR上配置.1.NSSA ABR在有或者没有一条默认路由在它的路由表中时都能产生一条默认路由.2.NSSA ASBR只有在当它的路由表中有一条默认路由时才能产生一条默认路由.(见实验六)实验六.NSSA Area and Default-Route Origiantion at ASBRObjective: Configure NSSA ASBR to advertise default-route as Type-7 LSADirections:Configure routers as per the OSPF scenario “NSSA Area Type 7to5 LSATranslator Election”Configure R6 to advertise default-route into NSSA Area (area 1 nssadefault-information-originate)Configure default static route to Null0 on R6Note that you can not use “default-information originate” router command,since it generates Type-5 LSA, which is prohibited in NSSA areaFinal ConfigurationR6:router ospf 1area 1 nssa default-information-originate―――为区域1产生7类默认路由.!ip route 0.0.0.0 0.0.0.0 null0―――因为是在NSSA ASBR上配置默认路由,所以前提是本地路由表中必须已经存在一条默认路由.VerificationR6#show ip routeCodes: C - connected, S - static, R - RIP, M - mobile, B - BGPD - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter areaN1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2E1 - OSPF external type 1, E2 - OSPF external type 2i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2ia - IS-IS inter area, * - candidate default, U - per-user static route o - ODR, P - periodic downloaded static routeGateway of last resort is 0.0.0.0 to network 0.0.0.0155.1.0.0/24 is subnetted, 2 subnetsC 155.1.146.0 is directly connected, GigabitEthernet0/1O IA 155.1.0.0 [110/65] via 155.1.146.1, 00:00:10, GigabitEthernet0/1 160.1.0.0/24 is subnetted, 1 subnetsS 160.1.60.0 is directly connected, Null0150.1.0.0/16 is variably subnetted, 4 subnets, 2 masksC 150.1.6.0/24 is directly connected, Loopback0O IA 150.1.5.5/32 [110/66] via 155.1.146.1, 00:00:10, GigabitEthernet0/1 O 150.1.4.4/32 [110/2] via 155.1.146.4, 00:00:11, GigabitEthernet0/1O 150.1.1.1/32 [110/2] via 155.1.146.1, 00:00:11, GigabitEthernet0/1S* 0.0.0.0/0 is directly connected, Null0R1#show ip route ospf160.1.0.0/24 is subnetted, 1 subnetsO N2 160.1.60.0 [110/20] via 155.1.146.6, 00:02:50, FastEthernet0/0150.1.0.0/16 is variably subnetted, 5 subnets, 2 masksO IA 150.1.6.0/24 [110/75] via 155.1.0.4, 00:03:01, Serial0/0O 150.1.6.6/32 [110/2] via 155.1.146.6, 00:03:01, FastEthernet0/0O 150.1.5.5/32 [110/65] via 155.1.0.5, 00:06:08, Serial0/0O 150.1.4.4/32 [110/2] via 155.1.146.4, 00:03:01, FastEthernet0/0O*N2 0.0.0.0/0 [110/1] via 155.1.146.6, 00:00:59, FastEthernet0/0――7类默认路由.R4#show ip route ospf160.1.0.0/24 is subnetted, 1 subnetsO E2 160.1.60.0 [110/20] via 155.1.146.6, 00:02:57, Ethernet0/1150.1.0.0/16 is variably subnetted, 5 subnets, 2 masksO 150.1.6.0/24 is a summary, 00:03:08, Null0O 150.1.6.6/32 [110/11] via 155.1.146.6, 00:03:08, Ethernet0/1O 150.1.5.5/32 [110/391] via 155.1.0.5, 00:06:17, Serial0/0O 150.1.1.1/32 [110/11] via 155.1.146.1, 00:03:08, Ethernet0/1O*E2 0.0.0.0/0 [110/1] via 155.1.146.6, 00:01:06, Ethernet0/1――被R1转换为5类.R5#show ip route ospf155.1.0.0/24 is subnetted, 3 subnetsO IA 155.1.146.0 [110/391] via 155.1.0.1, 00:04:24, Serial0/0160.1.0.0/24 is subnetted, 1 subnetsO E2 160.1.60.0 [110/20] via 155.1.0.1, 00:04:08, Serial0/0150.1.0.0/16 is variably subnetted, 6 subnets, 2 masksO IA 150.1.6.0/24 [110/401] via 155.1.0.4, 00:04:19, Serial0/0O IA 150.1.6.6/32 [110/392] via 155.1.0.1, 00:04:19, Serial0/0O IA 150.1.4.4/32 [110/391] via 155.1.0.4, 00:06:58, Serial0/0O IA 150.1.1.1/32 [110/391] via 155.1.0.1, 00:06:48, Serial0/0O*E2 0.0.0.0/0 [110/1] via 155.1.0.1, 00:02:17, Serial0/0R5#show ip ospf data exOSPF Router with ID (150.1.5.5) (Process ID 1)Type-5 AS External Link StatesRouting Bit Set on this LSALS age: 146Options: (No TOS-capability, DC)LS Type: AS External LinkLink State ID: 0.0.0.0 (External Network Number )Advertising Router: 150.1.100.100LS Seq Number: 80000001Checksum: 0xE3CBLength: 36Network Mask: /0Metric Type: 2 (Larger than any link state path)TOS: 0Metric: 1Forward Address: 150.1.6.6External Route Tag: 0Routing Bit Set on this LSALS age: 257Options: (No TOS-capability, DC)LS Type: AS External LinkLink State ID: 160.1.60.0 (External Network Number )Advertising Router: 150.1.100.100LS Seq Number: 80000001Checksum: 0xD7E6Length: 36Network Mask: /24Metric Type: 2 (Larger than any link state path)TOS: 0Metric: 20Forward Address: 150.1.6.6External Route Tag: 0OSPF相关命令:命令命令模式和描述router ospf process-id全局配置模式;进入对应PID的OSPF配置模式network ip-address [wildcard-mask] area area-id OSPF配置模式;定义匹配参数,将接口IP地址与其比较,如相符,即在该接口激活OSPFip ospf process-id area area-id [secondaries none]接口配置模式;在接口激活OSPF的另一种方法neighbor ip-address [priority number] [poll-interval seconds] [cost number] [database-filter all]OSPF配置模式;当需要定义邻接路由器的时候使用,定义了邻接路由器的IP地址、优先权、开销和查询间隔auto-cost reference-bandwidth ref-bw OSPF配置模式;修改OSPF参考带宽router-id ip-address OSPF配置模式;静态设置RIDospf log-neighbor-changes [detail]OSPF配置模式;显示邻接路由器状态改变的日志,默认启动passive-interface [default] {interface-type interface-number}OSPF配置模式;使OSPF在指定接口上停止发送Hello。
华为路由器配置OSPF的Stub区域实例
VLANIF 50
172.17.1.2/24
配置思路
采用如下的思路配置OSPF的Stub区域:
1.在各S-switch上使能OSPF,配置OSPF基本功能。
2.在S-switch-D上配置静态路由,并在OSPF中引入。
3.配置Area1为Stub区域(需要在Area1内所有的S-switch上配置Stub命令)。
192.168.1.1/24
S-switch-B
GE 0/0/1
VLANIF 10
192.168.0.2/24
S-switch-B
GE 0/0/2
VLANIF 30
192.168.2.1/24
S-switch-C
GE 0/0/1
VLANIF 20
192.168.1.2/24
S-switch-C
GE 0/0/2
Intra-area 1.1.1.1 0.0.0.1 1 192.168.1.1 ABR
Inter-area 4.4.4.4 0.0.0.1 3 192.168.1.1 ASBR
#查看S-switch-C的OSPF路由表。
[S-switch-C]display ospf routing
OSPF Process 1 with Router ID 3.3.3.3
#
ospf 1
area 0.0.0.1
network 192.168.1.0 0.0.0.255
network 172.16.1.0 0.0.0.255
stub
#
return
S-switch-D的配置文件
#
sysname S-switch-D
#
vlan batch 30 50
华为路由器OSPF配置实例
OSPF上机-1拓扑图1、组网和区域划分如上图所示。
2.在S3526-1、AR28-1、AR28-2、S3526-2的互联接口上启用ospf路由协议;并且在每台三层设备上引入直联路由,直联路由引入按照默认的type 2类型,R1<Huawei>undo terminal monitorInfo: Current terminal monitor is off.<Huawei>system-<Huawei>system-viewEnter system view, return user view with Ctrl+Z.[Huawei]int e0/0/0[Huawei-Ethernet0/0/0]ip add 172.16.0.1 24[Huawei-Ethernet0/0/0]int e[Huawei-Ethernet0/0/0]int[Huawei-Ethernet0/0/0]int e0/0/1[Huawei-Ethernet0/0/1]ip add 192.168.0.5 30 [Huawei-Ethernet0/0/1]qui[Huawei]inter[Huawei]interface loopback 0[Huawei-LoopBack0]ip add 1.1.1.1 32[Huawei-LoopBack0]qui[Huawei]router id 1.1.1.1[Huawei]ospf[Huawei-ospf-1]area 1[Huawei-ospf-1-area-0.0.0.1]network 192.168.0.4 0.0.0.3 [Huawei-ospf-1-area-0.0.0.1]qui[Huawei-ospf-1]import-route direct[Huawei-ospf-1]silent-interface loopback 0 [Huawei-ospf-1]R2<Huawei>undo terminal monitorInfo: Current terminal monitor is off.<Huawei>system-viewEnter system view, return user view with Ctrl+Z. [Huawei]interface Ethernet0/0/0[Huawei-Ethernet0/0/0]ip add 192.168.0.6 30[Huawei-Ethernet0/0/0]int e0/0/1[Huawei-Ethernet0/0/1]ip add 192.168.0.1 30[Huawei-Ethernet0/0/1]qui[Huawei]inter loopback 0[Huawei-LoopBack0]ip add 1.1.1.2 32[Huawei]router id 1.1.1.2[Huawei]ospf[Huawei-ospf-1]area 0[Huawei-ospf-1-area-0.0.0.0]network 192.168.0.0 0.0.0.3[Huawei-ospf-1-area-0.0.0.0]network 1.1.1.2 0.0.0.0[Huawei-ospf-1-area-0.0.0.0]qui[Huawei-ospf-1]area 1[Huawei-ospf-1-area-0.0.0.1]network 192.168.0.4 0.0.0.3[Huawei-ospf-1-area-0.0.0.1]qui[Huawei-ospf-1]R3<Huawei>undo terminal monitorInfo: Current terminal monitor is off.<Huawei>system-viewEnter system view, return user view with Ctrl+Z.[Huawei-Ethernet0/0/0]ip add 192.168.0.2 30 [Huawei-Ethernet0/0/0]int e0/0/1[Huawei-Ethernet0/0/1]ip add 192.168.0.9 30 [Huawei-Ethernet0/0/1]qui[Huawei]inter loop 0[Huawei-LoopBack0]ip add 1.1.1.3 32[Huawei-LoopBack0]qui[Huawei]router id 1.1.1.3[Huawei]ospf[Huawei-ospf-1]area 0[Huawei-ospf-1-area-0.0.0.0]net[Huawei-ospf-1-area-0.0.0.0]network 192.168.0.0 0.0.0.3 [Huawei-ospf-1-area-0.0.0.0]network 1.1.1.3 0.0.0.0 [Huawei-ospf-1-area-0.0.0.0]qui[Huawei-ospf-1]area 2[Huawei-ospf-1-area-0.0.0.2]network 192.168.0.8 0.0.0.3R4<Huawei>undo ter mInfo: Current terminal monitor is off.<Huawei>sysEnter system view, return user view with Ctrl+Z.[Huawei-Ethernet0/0/0]ip add 192.168.0.10 30[Huawei-Ethernet0/0/0]int e0/0/1[Huawei-Ethernet0/0/1]ip add 172.16.1.1 24[Huawei-Ethernet0/0/1]qui[Huawei]inter loop 0[Huawei-LoopBack0]ip add 1.1.1.4 32[Huawei-LoopBack0]qui[Huawei]router id 1.1.1.5[Huawei]ospf[Huawei-ospf-1]area 2[Huawei-ospf-1-area-0.0.0.2]network 192.168.0.8 0.0.0.3[Huawei-ospf-1-area-0.0.0.2]qui[Huawei-ospf-1]import-route direct cost 100(引入直连开销值为100) [Huawei-ospf-1][Huawei-ospf-1]import-route direct type 1(进入type 1 .第一类外部路由)上机2组网互联要求-1:1、链路COST值和区域划分如上图所示。
OSPF的多区域配置
03
区域内的路由器之间交换链路 状态信息,并通过区域内路由 汇总和过滤,减少路由器的资 源消耗。
02 多区域OSPF配置
配置多区域OSPF
创建多个OSPF区域
在OSPF路由器上创建多个区域,每个区域运行一个OSPF实例, 维护一个区域内路由数据库。
配置区域ID
为每个区域分配一个唯一的区域ID,用于标识该区域。
配置区域间路由的优先级
根据不同区域的优先级需,配置相应的区 域间路由优先级,确保关键业务的路由稳定 性。
优化区域内路由
优化区域内路由的路径
根据实际网络环境和业务需求,优化区域内路 由的路径选择,提高路由的稳定性和可靠性。
配置区域内路由的优先级
根据不同区域的优先级需求,配置相应的区域 内路由优先级,确保关键业务的路由稳定性。
THANKS FOR WATCHING
感谢您的观看
案例三:数据中心多区域OSPF配置
总结词
适用于数据中心网络,需要实现服务器和存储设备的 互联互通
详细描述
在数据中心网络中,通常会有多个数据中心,每个数据 中心内部配置有服务器和存储设备。为了实现服务器和 存储设备之间的互联互通,可以采用多区域OSPF配置。 在每个数据中心内部的局域网配置OSPF,并通过数据 中心的核心交换机将各局域网互联互通。同时,需要合 理规划各数据中心之间的网络拓扑和OSPF参数,以确 保网络的稳定性和可靠性。此外,还需要考虑数据中心 内部的安全性和可靠性,如采用冗余设备和链路等措施。
配置OSPF快速收敛
通过配置OSPF快速收敛相关参数(如Fast Hello Timer、Fast Retransmit等),提高 OSPF的收敛速度和稳定性。
04 OSPF多区域故障排除
ospf 的特殊区域 5
十九、ospf的特殊区域作用:缩减路由表,提高路由器的工作效率1、ospf特殊区域的分类‖‖末节区域:接收域内和域间,不接收外部路由,该区域接收1.2.3‖stub ‖类lsa,不接收4.5类,同时产生一条缺省路由,指向本区域外部。
‖(末节)‖命令:Area 1 stub‖‖完全末节区域:接收域内路由,不接收域间和外部,同时产生一‖‖条缺省,指向本区域外部,该区域接收1.2类lsa,不接收3.4.5类特殊区域‖‖命令:Area 1 stub no-summary‖‖‖次末节区域:接收域内和域间路由,不接收外部路由,该区域‖‖接收1.2.3.和7类,没有4.5.类。
‖NSSA ‖命令:Area 1 stub‖(次末节)‖完全次末节区域:接收域内路由,不接收域间和外部路由,同时‖‖产生一条缺省路由,指向本区域外部,该区域接收1.2.7类lsa没‖‖有3.4.5类‖‖命令:Area 1 nssa no-summary末节:只有一个出口的区域,就叫末节区域2、ospf网络lsa类型:1类lsa,路由标识为O,叫路由器lsa,ospf网络的每台路由器都会产生该类的lsa2类lsa,路由标识为O,叫网络lsa,该类lsa由DR产生。
(只会在广播型网络出现)3类lsa,路由标识为O IA,叫网络汇总lsa,由ABR产生,描述的是不同区域间的路由信息。
4类lsa,路由标识O IA,由ABR产生,描述ASBR的可达性,即谁是ASBR。
5类lsa,路由标识为OE,由ASBR产生,描述ospf外部路由信息。
7类lsa,路由标识为ON,nssa区域的ASBR产生,该类lsa是nssa区域所特有的,并且nssa区域的ABR有能力将7类的lsa转换为5类lsa传递到其他区域。
骨干区域不能配置末节或NSSA链路状态数据库显示:1类router link states2类net link states3类summary net link states (网络汇总)4类summary ASB link states5类type-5 AS External link states7类type-7 AS External link statesShow ip ospf database查看链路状态数据库Int s1/0Ip ospf network broadcast 把网络类型改成广播型更改成末节区域,需要把这个区域的每台路由器更改。
OSPF多实例
OSPF多实例OSPF是一个完美主义者,他的实现非常复杂,目的是做到无懈可击,虽然至今还有不尽如人意的地方,但是绝对堪称是IGP的权威,更有大批大批的粉丝用户,坚定的选用OSPF 作为IGP协议,并跟从OSPF的完美路由设计理念,尽可能的要求网络设计完美无缺。
当MPLS VPN的大潮涌来,BGP一下子与用户拉近了距离,成为了用户私网路由穿越骨干网的承载者。
OSPF自然眼红不已,当其他IGP路由协议纷纷丢盔弃甲将自己关在用户网络的一个小SITE里的时候,OSPF却仗着自己的IGP权威地位对BGP提出了新的要求,要求BGP在将OSPF路由从用户的一个SITE传到另一个SITE的时候携带OSPF的拓扑信息,让用户同一VPN的所有SITE俨然一个IGP整体。
我们下面的文字就将讲一讲这个“故事”,让我们这些网络建设者们明白当我们选用OSPF作为MPLS VPN的PE和CE之间的路由协议的时候,BGP为OSPF做了什么特殊的工作,OSPF自身又做了什么样的改进,以适应这种新的组网需求,最终让我们可以用这些协议实现的原理解释一些特殊的网络问题,并一一解决他们。
希望大家看过这篇文章后可以有所收获!首先我们就讲一讲BGP为OSPF做了什么。
前面我们说过BGP之所以单独为OSPF做一些特殊工作是因为OSPF要求BGP将OSPF路由从用户的一个SITE穿越骨干网传到另外一个SITE的时候,要保留OSPF的拓扑信息。
我们知道OSPF的拓扑信息包含在OSPF的intra-LSA里面,要想保留拓扑信息,BGP最好就是能够将OSPF的LSA传到对端而不是将OSPF路由传到对端。
果然BGP是这样做的,如何实现?我们知道BGP4+的RT属性是作为BGP的扩展属性放在BGP的一个叫Extended Community的地方,其实BGP的Extended Community不只是用来放RT属性,还可以用来携带OSPF的LSA信息,我们可以将他称为OSPF属性,这部分内容包括以下几个部分:1)Domian ID什么是Domian ID?Domian ID是一个用来表示OSPF域的值。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
上机报告姓名学号专业班级计科1101课程名称路由交换技术指导教师机房名称上机日期2013 年10月14 日上机项目名称上机步骤及内容:一、实验目的·掌握ospf协议的stub区域配置方法·掌握ospf协议的nssa区域配置方法二、实验仪器设备和材料清单器材:路由器4台,交换机2台,导线若干三、实验内容·掌握ospf协议的stub区域配置方法·掌握ospf协议的nssa区域配置方法四、实验步骤任务一stub区域配置图1.1 实验拓扑图一、配置stub区域1、R1的配置代码[R1]dis cu#version 5.20, Release 1808, Standard#sysname R1#domain default enable system##interface Ethernet0/0port link-mode routeip address 192.168.2.1 255.255.255.0#interface Ethernet0/0.1vlan-type dot1q vid 1ip address 202.168.0.1 255.255.255.0#interface Ethernet0/0.2vlan-type dot1q vid 2ip address 202.168.1.1 255.255.255.0#interface Ethernet0/0.3vlan-type dot1q vid 3ip address 202.168.2.1 255.255.255.0#interface Ethernet0/0.4vlan-type dot1q vid 4ip address 202.168.3.1 255.255.255.0#interface Ethernet0/1port link-mode routeip address 10.0.0.1 255.255.255.0#interface Serial1/0link-protocol ppp#interface Serial2/0link-protocol ppp#interface NULL0#interface LoopBack0ip address 1.1.1.1 255.255.255.255#ospf 1 router-id 1.1.1.1import-route directarea 0.0.0.1network 10.0.0.0 0.0.0.255network 1.1.1.0 0.0.0.255#[R1]2、R2的配置代码[R2]dis cur#version 5.20, Release 1808, Standard#dar p2p signature-file cfa0:/p2p_default.mtd #port-security enable#vlan 1#domain systeminterface Aux0async mode flowlink-protocol ppp#interface Ethernet0/0port link-mode routeip address 10.0.0.2 255.255.255.0 #interface Ethernet0/1port link-mode routeip address 20.0.0.1 255.255.255.0 #interface Serial1/0link-protocol ppp#interface Serial2/0link-protocol ppp#interface NULL0#interface LoopBack0ip address 2.2.2.2 255.255.255.255 #ospf 1 router-id 2.2.2.2area 0.0.0.0network 20.0.0.0 0.0.0.255 network 2.2.2.0 0.0.0.255area 0.0.0.1network 10.0.0.0 0.0.0.255#[R2]3、R3的配置代码[R3]dis cur##interface Ethernet0/0port link-mode routeip address 20.0.0.2 255.255.255.0 #interface Ethernet0/1port link-mode routeip address 30.0.0.1 255.255.255.0interface Serial1/0link-protocol ppp#interface Serial2/0link-protocol ppp#interface NULL0#interface LoopBack0ip address 3.3.3.3 255.255.255.255 #ospf 1 router-id 3.3.3.3area 0.0.0.0network 20.0.0.0 0.0.0.255 network 3.3.3.0 0.0.0.255area 0.0.0.2network 30.0.0.0 0.0.0.255stub#[R3]4、R4的配置代码[R4]dis cur#sysname R4#interface Ethernet0/0port link-mode routeip address 40.0.0.1 255.255.255.0 #interface Ethernet0/1port link-mode routeip address 30.0.0.2 255.255.255.0 #interface Serial1/0link-protocol ppp#interface Serial2/0link-protocol ppp#interface NULL0#interface LoopBack0ip address 4.4.4.4 255.255.255.255ospf 1 router-id 4.4.4.4area 0.0.0.2network 30.0.0.0 0.0.0.255network 40.0.0.0 0.0.0.255network 4.4.4.0 0.0.0.255stub#[R4]5、查看R1中的路由表信息图 1.2 R1的路由信息查看R4上面未配置和配置特殊区域对比:图1.3 未配置时的状态图1.4 配置后的状态任务二、配置totally stub区域1、R3中的配置代码#ospf 1area 0.0.0.1network 20.0.0.0 0.0.0.255area 0.0.0.2network 30.0.0.0.0.0.0.255stub no-summary#2、R4中的配置代码#ospf 1area 0.0.0.2network 30.0.0.0 0.0.0.255network 40.0.0.0 0.0.0.255stub no-summary#3、R4的路由信息图 3.1 R1中的路由信息任务2 Nssa区域配置图1.1 实验拓扑图一、o spf的配置注:ospf的配置中,只有R1的配置代码不一样,所以只需要改写R1的代码即可。
1、R1的配置代码#interface Ethernet0/0port link-mode routeip address 192.169.5.1 255.255.255.0#interface Ethernet0/0.1vlan-type dot1q vid 1ip address 192.169.6.1 255.255.255.0#interface Ethernet0/0.2ip address 192.169.7.1 255.255.255.0#interface Ethernet0/0.3vlan-type dot1q vid 3ip address 192.169.8.1 255.255.255.0#interface Ethernet0/0.4ip address 192.169.9.1 255.255.255.0#interface Ethernet0/1port link-mode route#interface Serial1/0link-protocol pppip address 10.0.3.2 255.255.255.0#interface LoopBack0ip address 1.1.1.1 255.255.255.255#ospf 1area 0.0.0.2network 10.0.3.0 0.0.0.255network 192.169.5.0 0.0.0.255network 192.169.6.0 0.0.0.255network 192.169.7.0 0.0.0.255network 192.169.8.0 0.0.0.255network 192.169.9.0 0.0.0.255#2、R1的路由信息图 2.1 R1的路由信息二、配置NSSA区域R3上面的配置信息:[R3]dis cur#version 5.20, Release 1808, Standard #interface Ethernet0/0port link-mode routeip address 20.0.0.2 255.255.255.0#interface Ethernet0/1port link-mode routeip address 30.0.0.1 255.255.255.0#interface Serial1/0link-protocol ppp#interface Serial2/0link-protocol ppp#interface NULL0#interface LoopBack0ip address 3.3.3.3 255.255.255.255 #ospf 1 router-id 3.3.3.3area 0.0.0.0network 20.0.0.0 0.0.0.255 network 3.3.3.0 0.0.0.255area 0.0.0.2network 30.0.0.0 0.0.0.255nssa default-route-advertise#return[R3]R4上面的配置信息:[R4]dis cur#interface Ethernet0/0.1vlan-type dot1q vid 1ip address 202.168.4.1 255.255.255.0 #interface Ethernet0/0.2vlan-type dot1q vid 2ip address 202.168.5.1 255.255.255.0#interface Ethernet0/0.3vlan-type dot1q vid 3ip address 202.168.6.1 255.255.255.0#interface Ethernet0/0.4vlan-type dot1q vid 4ip address 202.168.7.1 255.255.255.0#interface Ethernet0/1port link-mode routeip address 30.0.0.2 255.255.255.0#interface Serial1/0link-protocol ppp#interface Serial2/0link-protocol ppp#interface NULL0#interface LoopBack0ip address 4.4.4.4 255.255.255.255#ospf 1 router-id 4.4.4.4import-route directarea 0.0.0.2network 30.0.0.0 0.0.0.255network 4.4.4.0 0.0.0.255nssa#return[R4]R4上面的特殊区域LSDB链路状态数据库图2.1 R4上面的LSDB表图2.2 R4的路由信息总结:通过这次实验,我发现问题不仅仅是从书本上获得的,更多的问题是在做实验的过程中,反反复复实验后,才发现的。