ospf实验.doc_第1页
ospf实验.doc_第2页
ospf实验.doc_第3页
ospf实验.doc_第4页
ospf实验.doc_第5页
已阅读5页,还剩50页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

CCNP Lab ManualLab 1. Configuring Basic Multi Area OSPF and Area Summary实验目的:1、掌握多区域的OSPF配置方法。2、区别不同区域的路由。3、掌握OSPF的路由汇总配置。4、掌握OSPF的基本配置命令。实验拓扑图:实验步骤及要求:1、配置各台路由器的IP地址,并且使用Ping命令确认各路由器的直连口的互通性。2、在R1上进行area 1区域OSPF配置。R1(config)#router ospf 1R1(config-router)#network 55 area 1在配置network时,使用area参数指出从属于哪一个区域.R1(config-router)#network 55 area 1R1(config-router)#network area 1R1(config-router)#exit3、在R2上进行area1与area2的区域边界路由器(ABR)的OSPF配置。R2(config)#router ospf 1R2(config-router)#network area 1区域1的networkR2(config-router)#network area 0区域0的networkR2(config)#exit4、参照R1与R2的配置,完成R3与R4的配置。5、在任一路由器上,查看OSPF邻居表。R2#show ip ospf neighbor Neighbor ID Pri State Dead Time Address Interface 1 FULL/ - 00:00:39 Serial1/ 1 FULL/ - 00:00:37 Serial1/0R2路由器已经成功与R1与R3建立邻居关系。R2#6、查看R1的路由表,观察其它区域路由。R1#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 N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGPGateway of last resort is not set /32 is subnetted, 2 subnetsO IA 110/193 via , 00:02:23, Serial1/1O IA 110/193 via , 00:02:23, Serial1/1其它区域的路由会使用IA作为前缀。IA=OSPF inter area /24 is subnetted, 2 subnetsC is directly connected, Loopback1C is directly connected, Loopback0 /30 is subnetted, 3 subnetsO IA 110OSPF的管理距离为110。/192 via , 00:02:58, Serial1/1C is directly connected, Serial1/1O IA 110/128OSPF对于此链路计算的cost值。Cost= 108 / Bandwidth需要注意的是此处bandwidth并不是指链路的物理带宽。其可以通过bandwidth命令进行修改。Serial接口默认的带宽为T1即1.544Mbps。 via , 00:05:06, Serial1/1R1#7、查看R1的OSPF链路状态数据库。R1#show ip ospf database OSPF Router with ID () (Process ID 1) Router Link States (Area 1)类型1的LSA。Link ID ADV Router Age Seq# Checksum Link count 492 0x80000004 0x00C83F 4 486 0x80000003 0x002BB5 2 Summary Net Link States (Area 1)类型3的LSA,描述区域间的路由。Link ID ADV Router Age Seq# Checksum 315 0x80000001 0x00CCC0 315 0x80000001 0x00C1CA 479 0x80000001 0x00E33E 350 0x80000001 0x003E9FR1#8、在R1上使用ping命令确认路由的有效性。R1#ping Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to , timeout is 2 seconds:!Success rate is 100 percent (5/5), round-trip min/avg/max = 216/240/288 msR1#9、查看R4的路由表和ospf的链路状态数据库。R4#show ip route /24 is subnetted, 2 subnetsC is directly connected, Loopback0C is directly connected, Loopback1 /24 is subnetted, 2 subnetsO IA 110/193 via , 00:15:14, Serial1/0O IA 110/193 via , 00:15:14, Serial1/0 /30 is subnetted, 3 subnetsC is directly connected, Serial1/0O IA 110/192 via , 00:15:14, Serial1/0O IA 110/128 via , 00:15:14, Serial1/0R4#R4#show ip ospf database OSPF Router with ID () (Process ID 1) Router Link States (Area 2)Link ID ADV Router Age Seq# Checksum Link count 1223 0x80000004 0x00B871 4 1224 0x80000002 0x00EA2E 2 Summary Net Link States (Area 2)Link ID ADV Router Age Seq# Checksum 2 0x80000001 0x00B586 2 0x80000001 0x00AA90关于area 1的两条类型3的LSA.。 1265 0x80000001 0x00766B 1265 0x80000001 0x00CB52R4#可以发现R4路由器学习到area1区域的具体路由,其实,可以通过在R2(ABR)上可以对area1的路由进行汇总,通过汇总可以有效的减少路由表的大小,限制LSA扩散。10、配置R2的区域汇总。R2(config)#router ospf 1R2(config-router)#area 1 range 使用area 1 range命令对区域1的路由进行汇总。R2(config-router)#exitR2(config)#exit11、再次查看R4的路由表和数据库。R4#show ip route /24 is subnetted, 2 subnetsC is directly connected, Loopback0C is directly connected, Loopback1 /16 is subnetted, 1 subnetsO IA 110/193 via , 00:00:32, Serial1/0Area 1的路由已经成功的被汇总。如果area 1存在多条路由的话,这样做是很有实际意义的。 /30 is subnetted, 3 subnetsC is directly connected, Serial1/0O IA 110/192 via , 00:18:36, Serial1/0O IA 110/128 via , 00:18:36, Serial1/0R4#R4#show ip ospf database OSPF Router with ID () (Process ID 1) Router Link States (Area 2)Link ID ADV Router Age Seq# Checksum Link count 6 0x80000005 0x00B672 4 13 0x80000004 0x00E630 2 Summary Net Link States (Area 2)Link ID ADV Router Age Seq# Checksum 29 0x80000001 0x00C07C对于area 1的区域仅有一条类型3的LSA。 1325 0x80000001 0x00766B 1325 0x80000001 0x00CB52R4#12、实验完成。工大瑞普Cisco课程开发小组CCNP Lab ManualLab 2. Configuring OSPF in NBMA实验目的:1、掌握NBMA网络中OSPF的邻居关系手工和自动建立的两种配置方法。2、掌握指定OSPF的接口优先级和通过修改OSPF的默认接口网络类型避免DR的选举出错。实验拓扑图:实验步骤及要求:1、配置各台路由器的IP地址,并且使用Ping命令确认各路由器的直连口的互通性。2、其中R1、R2和R3的配置如下: R1(config)#interface loopback 0R1(config-if)#ip address R1(config-if)#ip ospf network point-to-point 避免其环回接口地址被OSPF学习为/32的主机地址。R1(config-if)#exitR1(config)#R1(config)#interface serial 1/2 R1(config-if)#ip add R1(config-if)#encapsulation frame-relay R1(config-if)#no frame-relay inverse-arp关闭反向ARP。R1(config-if)#frame-relay map ip 102 broadcast R1(config-if)#frame-relay map ip 103 broadcast采用手工映射配置。主要目的是配置星形的帧中继拓扑网络。并且在映射时,采用BROADCAST关键字,以便帧中继可以支持广播的转发。R1(config-if)#exitR1(config)#R1(config)#router ospf 1R1(config-router)#network 55 area 0R1(config-router)#network 55 area 0R1(config-router)#exitR1(config)#R2(config)#interface loopback 0R2(config-if)#ip address R2(config-if)#ip ospf network point-to-point R2(config-if)#exitR2(config)#R2(config)#interface serial 1/2R2(config-if)#encapsulation frame-relay R2(config-if)#ip address R2(config-if)#no frame-relay inverse-arp R2(config-if)#frame-relay map ip 201 broadcast R2(config-if)#no shutdownR2(config-if)#exitR2(config)#R2(config)#router ospf 1R2(config-router)#network 55 area 0R2(config-router)#network 55 area 0R2(config-router)#exitR2(config)#R3(config)#interface loopback 0R3(config-if)#ip address R3(config-if)#ip ospf network point-to-point R3(config-if)#exitR3(config)#R3(config)#interface serial 1/2R3(config-if)#ip address R3(config-if)#encapsulation frame-relay R3(config-if)#no frame-relay inverse-arp R3(config-if)#frame-relay map ip 301 broadcast R3(config-if)#no shutdownR3(config-if)#exitR3(config)#R3(config)#router ospf 1R3(config-router)#network 55 area 0R3(config-router)#network 55 area 0R3(config-router)#exitR3(config)#3、在配置完OSPF协议后,查看R1、R2或R3路由器OSPF的邻居表,会发现OSPF的邻居关系并没有被建立:R1#show ip ospf neighbor R1#4、查看R1的Seiral 1/2接口OSPF信息:R1#show ip ospf interface serial 1/2Serial1/2 is up, line protocol is up Internet Address /24, Area 0 Process ID 1, Router ID , Network Type NON_BROADCASTOSPF默认会把帧中继的接口看成非广播的网络,而不受映射时是否追加BROADCAST的参数影响。, Cost: 64 Transmit Delay is 1 sec, State DR, Priority 1 Designated Router (ID) , Interface address No backup designated router on this network Timer intervals configured, Hello 30, Dead 120, Wait 120, Retransmit 5 oob-resync timeout 120 Hello due in 00:00:15 Index 1/1, flood queue length 0 Next 0x0(0)/0x0(0) Last flood scan length is 0, maximum is 0 Last flood scan time is 0 msec, maximum is 0 msec Neighbor Count is 0, Adjacent neighbor count is 0 Suppress hello for 0 neighbor(s)R1#5、通过分析可以看出,影响OSPF协议不能自己形成邻居关系的主要原因是,OSPF主观 认为NBMA的广播不支持广播和组播,因此不会主动的向外发送OSPF的HELLO数据包。6、手工配置R1路由器的OSPF邻居关系:R1(config)#router ospf 1R1(config-router)#neighbor 手工指定OSPF的邻居,当配置完此命令后,OSPF会采用单播数据包与邻居联系,建立邻居关系。R1(config-router)#neighbor R2(config)#router ospf 1R2(config-router)#neighbor R3(config)#router ospf 1R3(config-router)#neighbor 7、当配置完成后,系统IOS会提示如下信息:*Jun 18 15:36:16.743: %OSPF-5-ADJCHG: Process 1, Nbr on Serial1/2 from LOADING to FULL, Loading Done邻居关系成功的创建。*Jun 18 15:36:16.747: %OSPF-5-ADJCHG: Process 1, Nbr on Serial1/2 from LOADING to FULL, Loading Don8、查看R1的邻居表:R1#show ip ospf neighbor Neighbor ID Pri State Dead Time Address Interface 1 FULL/DROTHER 00:01:31 Serial1/2 1 FULL/DR 00:01:57 Serial1/2R1#9、除了手工的配置方法之外,其实也可能修改OSPF的接口类型,以便路由器能够自动的创建OSPF的邻居关系,配置比较简单,也不容易出错。首先,将之前配置的neighbor的命令给no掉。然后再做配置如下:R1(config)#interface serial 1/2R1(config-if)#ip ospf network broadcast强制配置S1/2的接口为广播类型的接口。 R1(config-if)#exit10、查看接口信息:R1#show ip ospf interface serial 1/2Serial1/2 is up, line protocol is up Internet Address /24, Area 0 Process ID 1, Router ID , Network Type BROADCAST, Cost: 64Transmit Delay is 1 sec, State DR, Priority 1R1#11、查看R1、R2和R3路由器的OSPF邻居表:R1#show ip ospf neighbor Neighbor ID Pri State Dead Time Address Interface 1 FULL/DROTHER 00:00:32 Serial1/2 1 FULL/DR 00:00:33 Serial1/2R1#R2#show ip ospf neighbor Neighbor ID Pri State Dead Time Address Interface 1 FULL/BDR 00:00:30 Serial1/2R2#R3#show ip ospf neighbor Neighbor ID Pri State Dead Time Address Interface 1 FULL/BDR 00:00:39 Serial1/2R3#12、仔细观察OSPF的邻居表,会发现如下问题:R1的OSPF邻居表,指出为DR,为DROTHER,而自己为BDR。R2的OSPF邻居表,指出为BDR,而自己为DR。R3的OSPF邻居表,指出为BDR,而自己为DR。通过如下图示,可以更清楚看出DR和BDR的关系:出现此问题的原因是因为Frame-Relay的网络拓扑非全网状。R3在与R1在进行邻居创建时,R3并不知道网络中还有R2的存在。同时,R2与R1进行创建时,也不知晓R3的存在。此时,在网络中运行的其实是两个不同的OSPF的自治系统。13、由于上述的问题,还会导致其它原因,比如:R3路由器的/24的子网出错,R3会向R1通告LSA,R1在收到此LSA后,R1并不会向R3转发,其原因是,R1认为R3是由DR来完成通告的。其默守OSPF的多路访问网络的更新规则。另外:如果R1的/24网络出错,R1默认会向DR通告,即向R3通告,而不会向R2通告,因为R1作为BDR,只需要将LSA通告给DR即可,而其它的DROTHER的通告是由DR完成的,而做为DR的R3在收到R1发送的LSA后,R3实际上并没有向R2通告,这是因为R3并不知道网络中还有R2的存在。14、要解决这样的问题,必须手工的指定网络的DR的角色。由于OSPF的优先级会影响DR的选举,优先级为0的OSPF的路由永远不能成为DR,优先级越高越容易成为DR的原则,默认OSPF的优先级为1,因此将R2与R3的优先级直接修改为0,配置如下:R2(config)#interface serial 1/2R2(config-if)#ip ospf priority 0R2(config-if)#exitR2(config)#R3(config)#interface serial 1/2R3(config-if)#ip ospf priority 0R3(config-if)#exit15、查看所有路由器的邻居表,从邻居表可以看出OSPF各台路由器,已经拥有合适的角色:R1#show ip ospf neighbor Neighbor ID Pri State Dead Time Address Interface 0 FULL/DROTHER 00:00:38 Serial1/2 0 FULL/DROTHER 00:00:39 Serial1/2R1#R2#show ip ospf neighbor Neighbor ID Pri State Dead Time Address Interface 1 FULL/DR 00:00:31 Serial1/2R2#R3#show ip ospf neighbor Neighbor ID Pri State Dead Time Address Interface 1 FULL/DR 00:00:38 Serial1/2R3#16、其实也可以修改OSPF的接口类型,以避免DR和BDR的选举,从而减少DR选举出错的可能性。比如,将R1的接口网络类型修改为P2MP(点到多点),而将R2和R3的接口网络类型修改为P2P(点对点)。因为在OSPF的各种网络类型中:P2MP和P2P都是不需要选举DR和BDR的。17、另外,在配置接口网络类型时,还注意接口的HELLO死亡间隔时间。因为不同的类型的网络其时间是不一致的。不一致的HELLO的时间间隔,会导致OSPF的邻居关系无法创建。18、下面给出一张OSPF所支持的网络类型和DR选举,以及HELLO时间间隔的表,以供参阅。具体配置不再列出。19、实验完成。工大瑞普Cisco课程开发小组CCNP Lab ManualLab 3. Configuring OSPF Authentication实验目的:1、掌握OSPF接口认证及区域认证的配置方法。实验拓扑图:实验步骤及要求:1、配置各台路由器的IP地址,并且使用Ping命令确认各路由器的直连口的互通性。2、配置OSPF协议,并使用相关命令确认其正常工作。3、查看R1和R2的路由表。 R1#show ip route Gateway of last resort is not set /24 is subnetted, 2 subnetsO IA 110/193 via , 00:01:02, Serial1/1O IA 110/193 via , 00:01:02, Serial1/1 /24 is subnetted, 2 subnetsC is directly connected, Loopback0C is directly connected, Loopback1 /30 is subnetted, 3 subnetsO IA 110/192 via , 00:01:12, Serial1/1C is directly connected, Serial1/1O IA 110/128 via , 00:05:47, Serial1/1通过OSPF协议学习到的其它区域的路由。R1#R2#show ip route Gateway of last resort is not set /24 is subnetted, 2 subnetsO IA 110/129 via , 00:09:16, Serial1/1O IA 110/129 via , 00:09:16, Serial1/1 /24 is subnetted, 2 subnetsO 110/65 via , 00:14:00, Serial1/0O 110/65 via , 00:14:00, Serial1/0 /30 is subnetted, 3 subnetsO IA 110/128 via , 00:09:26, Serial1/1C is directly connected, Serial1/0C is directly connected, Serial1/1R2#4、在R1上启用OSPF的明文认证,配置如下:R1(config)#interface serial 1/1R1(config-if)#ip ospf authentication启用OSPF的认证。R1(config-if)#ip ospf authentication-key cisco使用明文密码进行认证。R1(config-if)#exit5、配置完成后,打开debug观察系统提示系统。00:30:33: OSPF: address on Serial1/1 is dead00:30:33: OSPF: address on Serial1/1 is dead, state DOWN00:30:33: %OSPF-5-ADJCHG: Process 1, Nbr on Serial1/1 from FULL to DOWN, Neighbor Down: Dead timer expired00:30:35: OSPF: Rcv pkt from , Serial1/1 : Mismatch Authentication type认证失败。导致邻居关系down. Input packet specified type 0, we use type 100:54:45: OSPF: Rcv pkt from , Serial1/1 : Mismatch Authentication Key - Clear Text此处信息指出R1配置的是明文的认证。6、在R2上启用OSPF的认证:R2(config)#interface s1/1R2(config-if)#ip ospf authenticationR2(config-if)#ip ospf authentication-key ciscoR2(config-if)#exitR2(config)#exit7、查看R1的debug信息和路由表信息:00:54:55: OSPF: 2 Way Communication to on Serial1/1, state 2WAY00:54:55: OSPF: Send DBD to on Serial1/1 seq 0x2154 opt 0x42 flag 0x7 len 3200:54:55: OSPF: Rcv DBD from on Serial1/1 seq 0x182 opt 0x42 flag 0x7 len 32 mtu 1500 state EXSTART00:54:55: OSPF: NBR Negotiation Done. We are the SLAVE00:54:55: OSPF: Send DBD to on Serial1/1 seq 0x182 opt 0x42 flag 0x2 len 15200:54:55: OSPF: Rcv DBD from on Serial1/1 seq 0x183 opt 0x42 flag 0x3 len 152 mtu 1500 state EXCHANGE00:54:55: OSPF: Send DBD to on Serial1/1 seq 0x183 opt 0x42 flag 0x0 len 3200:54:55: OSPF: Database request to 00:54:55: OSPF: sent LS REQ packet to , length 6000:54:55: OSPF: Rcv DBD from on Serial1/1 seq 0x184 opt 0x42 flag 0x1 len 32 mtu 1500 state EXCHANGE00:54:55: OSPF: Exchange Done with on Serial1/100:54:55: OSPF: Send DBD to on Serial1/1 seq 0x184 opt 0x42 flag R1#0x0 len 3200:54:55: OSPF: Synchronized with on Serial1/1, state FULL00:54:55: %OSPF-5-ADJCHG: Process 1, Nbr on Serial1/1 from LOADING to FULL, Loading Done00:54:56: OSPF: Build router LSA for area 1, router ID , seq 0x8000000CR1#show ip route Gateway of last resort is not set /24 is subnetted, 2 subnetsO IA 110/193 via , 00:01:53, Serial1/1O IA 110/193 via , 00:01:53, Serial1/1 /24 is subnetted, 2 subnetsC is directly connected, Loopback0C is directly connected, Loopback1 /30 is subnetted, 3 subnetsO IA 110/192 via , 00:01:53, Serial1/1C is directly connected, Serial1/1O IA 110/128 via , 00:01:53, Serial1/1由于认证成功。R1再次学习到网络的路由。R1#8、另外:配置基于MD5的密码接口认证示例如下,配置完成后,请自行检查确认,此处不在重复确认过程:R1(config)#interface serial 1/1 R1(config-if)#ip ospf authentication message-digest 启用基于md5密码的认证。R1(config-if)#ip ospf message-digest-key 1 md5 cisco设置认证密码。其中数字 1 标识key的id。最多可以设置255个密码。R1(config-if)#exitR1(config)#R2(config)#interface serial 1/0R2(c

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论