实验4路由协议OSPF_第1页
实验4路由协议OSPF_第2页
实验4路由协议OSPF_第3页
实验4路由协议OSPF_第4页
实验4路由协议OSPF_第5页
已阅读5页,还剩11页未读 继续免费阅读

下载本文档

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

文档简介

1、实验4. 动态路由OSPF1 背景知识 OSPF是由IETF的IGP工作组为ip网开发的路由协议。该工作组成立于1998年,专门设计用于因特网的基于最短路径优先(SPF)算法的IGP。与IGRP类似,OSPF创建的原因是到了八十年代中期,RIP不能服务于大型、异构网络的缺陷愈发明显。 OSPF有两个主要的特性。首先该协议是开放的,即其规范是公开的,公布的OSPF规范是RFC1247。另一个基本的特性是OSPF基于SPF算法,该算法也称为Dijkstra算法,即以创建该算法的人来命名。2 实验需求:思科路由器C3640三台3 实验目的通过本实验可以掌握:在路由器上启动OSPF 路由进程启用参与路

2、由协议的接口,并且通告网络及所在的区域认识DR和BDR选举OSPF特殊区域配置OSPF 认证的类型和意义基于区域的OSPF 简单口令认证和MD5的配置和调试OSPF路由汇总验证OSPF 路由协议相关信息4 实验拓扑5 实验步骤 实验基本配置省略5.1 OSPF单区域和多区域配置配置R1路由器R1(config)#router ospf 1 /开启ospf进程,进程ID本地有效,可一样也可以不一样R1(config-router)#network 1.1.1.1 0.0.0.0 area 1 /通告网段的时候要注意的area IDR1(config-router)#network 12.1.1.

3、0 0.0.0.3 area 0 /此网段要通告到area 0 R1(config-router)#end配置R2路由器 R2(config)#router ospf 1R2(config-router)#network 12.1.1.0 0.0.0.3 area 0 /这里三个网段都是area 0 R2(config-router)#network 2.2.2.2 0.0.0.0 area 0R2(config-router)#network 23.1.1.0 0.0.0.3 area 0R2(config-router)#exit配置R3路由器R3(config)#router ospf

4、1R3(config-router)#network 23.1.1.0 0.0.0.3 area 0 /此网段属于区域0R3(config-router)#network 3.3.3.3 0.0.0.0 area 3 /此网段属于区域3查看R1和R3的路由表R1#show ip routeCodes: C - connected, S - static, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type

5、1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2 i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2 ia - IS-IS inter area, * - candidate default, U - per-user static route o - ODR, P - periodic downloaded static routeGateway of last resort is

6、not set 1.0.0.0/32 is subnetted, 1 subnetsC 1.1.1.1 is directly connected, Loopback0 2.0.0.0/32 is subnetted, 1 subnetsO 2.2.2.2 110/65 via 12.1.1.2, 00:13:15, Serial2/0 /区域内的路由 3.0.0.0/32 is subnetted, 1 subnetsO IA 3.3.3.3 110/66 via 12.1.1.2, 00:13:15, Serial2/0 /区域间的路由 23.0.0.0/30 is subnetted,

7、1 subnetsO 23.1.1.0 110/65 via 12.1.1.2, 00:13:15, Serial2/0 12.0.0.0/30 is subnetted, 1 subnetsC 12.1.1.0 is directly connected, Serial2/0R3#sh ip routeCodes: C - connected, S - static, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area N1 - OSPF NSSA extern

8、al type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2 i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2 ia - IS-IS inter area, * - candidate default, U - per-user static route o - ODR, P - periodic downloaded static routeGateway of last re

9、sort is not set 1.0.0.0/32 is subnetted, 1 subnetsO IA 1.1.1.1 110/66 via 23.1.1.1, 00:13:37, FastEthernet0/0 /区域间的路由 2.0.0.0/32 is subnetted, 1 subnetsO 2.2.2.2 110/2 via 23.1.1.1, 00:13:37, FastEthernet0/0 /区域内的路由 3.0.0.0/32 is subnetted, 1 subnetsC 3.3.3.3 is directly connected, Loopback0 23.0.0.

10、0/30 is subnetted, 1 subnetsC 23.1.1.0 is directly connected, FastEthernet0/0 12.0.0.0/30 is subnetted, 1 subnetsO 12.1.1.0 110/65 via 23.1.1.1, 00:13:37, FastEthernet0/0查看R2的ospf的邻居(邻接)关系R2#show ip ospf neighbor Neighbor ID Pri State Dead Time Address Interface3.3.3.3 1 FULL/BDR 00:00:38 23.1.1.2 F

11、astEthernet0/01.1.1.1 0 FULL/ - 00:00:31 12.1.1.1 Serial2/0备注:以太网链路有DR、BDR的选举,WAN链路(点到点)不选择DR、BDR查看运行了ospf路由协议的接口 R2#sh ip os int f0/0 FastEthernet0/0 is up, line protocol is up Internet Address 23.1.1.1/30, Area 0 / 此接口地址及这个接口所在的区域 Process ID 1, Router ID 2.2.2.2, Network Type BROADCAST, Cost: 1 /网

12、络环境类型 Transmit Delay is 1 sec, State DR, Priority 1 /DR或者是BDR,优先级 /Router-ID也是 / Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5 /存活时间 oob-resync timeout 40 Hello due in 00:00:09 Supports Link-local Signaling (LLS) Index 3/3, flood queue length 0 Next 0 x0(0)/0 x0(0) Last flood

13、scan length is 0, maximum is 1 Last flood scan time is 0 msec, maximum is 0 msec Neighbor Count is 1, Adjacent neighbor count is 1 /邻居个数 Adjacent with neighbor 3.3.3.3 (Backup Designated Router) /邻接个数 Suppress hello for 0 neighbor(s) R2#sh ip ospf int s2/0 /无DR、BDR 的选举 Serial2/0 is up, line protocol

14、 is up Internet Address 12.1.1.2/30, Area 0 Process ID 1, Router ID 2.2.2.2, Network Type POINT_TO_POINT, Cost: 64 /网络环境 Transmit Delay is 1 sec, State POINT_TO_POINT, Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5 oob-resync timeout 40 Hello due in 00:00:01 Supports Link-local

15、 Signaling (LLS) Index 1/1, flood queue length 0 Next 0 x0(0)/0 x0(0) Last flood scan length is 1, maximum is 2 Last flood scan time is 0 msec, maximum is 0 msec Neighbor Count is 1, Adjacent neighbor count is 1 /邻居个数 /邻接个数 Suppress hello for 0 neighbor(s)R3# /测试与的连通性Type escape sequence to abort.Se

16、nding 5, 100-byte ICMP Echos to 1.1.1.1, timeout is 2 seconds:!Success rate is 100 percent (5/5), round-trip min/avg/max = 12/38/80 msType escape sequence to abort.Sending 5, 100-byte ICMP Echos to 12.1.1.1, timeout is 2 seconds:!Success rate is 100 percent (5/5), round-trip min/avg/max = 8/27/52 ms

17、5.2 OSPF特殊区域配置实验拓扑:实验步骤基本配置略,stub区域作用:R1所处的区域1路由器性能不是太好,不需要学习全部的OSPF路由条目,可以把AREA 1设置为特殊区域配置R2 区域1为stub区域R2(config)#router ospf 1R2(config-router)#area 1 stub配置R1区域1为stub区域R1(config)#router ospf 1R1(config-router)#area 1 stub查看R1路由表 /可以观察在R1路由表多了一条OSPF的默认路由,即拒绝了5类LSA.5.3 OSPF认证实验拓扑 AERA 0 5.3.1 基于区域的

18、OSPF 简单口令认证实验步骤 (接口IP地址、ospf路由启用配置略)(1)配置路由器R1R1(config)#router ospf 1R1(config-router)#network .0 255.255.255.0 area 0R1(config-router)#network 1.1.1.0 255.255.255.0 area 0R1(config-router)#area 0 authentication /区域0 启用简单口令认证R1(config)#interface s2/0R1(config-if)#ip ospf authentication-key cisco /配

19、置认证密码(2)配置路由器R2R2(config)#router ospf 1R2(config-router)#network 2.2.2.0 255.255.255.0 area 0R2(config-router)#network 255.255.255.0 area 0R2(config-router)#area 0 authenticationR2(config)#interface s2/1R2(config-if)#ip ospf authentication-key cisco实验验证(1)show ip ospf interfaceR1#show ip ospf interf

20、ace s2/0Serial2/0 is up, line protocol is up Internet Address 12.1.1.1/24, Area 0 Process ID 1, Router ID 1.1.1.1, Network Type POINT_TO_POINT, Cost: 64 Transmit Delay is 1 sec, State POINT_TO_POINT, Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5 oob-resync timeout 40 Hello due

21、 in 00:00:09 Supports Link-local Signaling (LLS) Index 2/2, flood queue length 0 Next 0 x0(0)/0 x0(0) Last flood scan length is 1, maximum is 1 Last flood scan time is 0 msec, maximum is 0 msec Neighbor Count is 1, Adjacent neighbor count is 1 Suppress hello for 0 neighbor(s) Simple password authent

22、ication enabled /简单口令认证(2)show ip ospfR1#show ip ospfSupports only single TOS(TOS0) routes.Area BACKBONE(0)Number of interfaces in this area is 2 (1 loopback)Area has simple password authentication /简单口令认证SPF algorithm last executed 00:00:01.916 agoSPF algorithm executed 5 timesArea ranges areNumber

23、 of LSA 2. Checksum Sum 0 x010117Number of opaque link LSA 0. Checksum Sum 0 x000000Number of DCbitless LSA 0Number of indication LSA 0Number of DoNotAge LSA 0Flood list length 0 通过以上输出信息,可以得知OSPF采用简单口令认证方式。5.3.2 基于区域的OSPF MD5 认证(1)配置路由器R1R1(config)#router ospf 1R1(config-router)#network 255.255.255

24、.0 area 0R1(config-router)#network 1.1.1.0 255.255.255.0 area 0R1(config-router)#area 0 authentication message-digest /区域0启用MD5 认证R1(config)#interface s2/0R1(config-if)#ip ospf message-digest-key 1 md5 cisco /配置认证key ID 及密匙(2)配置路由器R2R2(config)#router ospf 1R2(config-router)#network 2.2.2.0 255.255.2

25、55.0 area 0R2(config-router)#network .0 255.255.255.0 area 0R2(config-router)#area 0 authentication message-digestR2(config)#interface s2/1R2(config-if)#ip ospf message-digest-key 1 md5 cisco实验验证(1)show ip ospf interfaceR1#show ip ospf interface s2/0Serial2/0 is up, line protocol is up Internet Addr

26、ess 12.1.1.1/24, Area 0 Process ID 1, Router ID 1.1.1.1, Network Type POINT_TO_POINT, Cost: 64 Transmit Delay is 1 sec, State POINT_TO_POINT, Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5 oob-resync timeout 40 Hello due in 00:00:09 Supports Link-local Signaling (LLS) Index 2/2

27、, flood queue length 0 Next 0 x0(0)/0 x0(0) Last flood scan length is 1, maximum is 1 Last flood scan time is 0 msec, maximum is 0 msec Neighbor Count is 1, Adjacent neighbor count is 1 Suppress hello for 0 neighbor(s) Message digest authentication enabled Youngest key id is 1 /MD5认证方式(2)show ip osp

28、fR1#show ip ospfSupports only single TOS(TOS0) routes.Area BACKBONE(0)Number of interfaces in this area is 2 (1 loopback)Area has message digest authentication /MD5认证方式SPF algorithm last executed 00:00:01.916 agoSPF algorithm executed 5 timesArea ranges areNumber of LSA 2. Checksum Sum 0 x010117Numb

29、er of opaque link LSA 0. Checksum Sum 0 x000000Number of DCbitless LSA 0Number of indication LSA 0Number of DoNotAge LSA 0Flood list length 0 通过以上输出信息,可以得知OSPF采用MD5认证方式。5.3.3 基于接口的OSPF 简单口令认证配置R1路由器 R1(config)#interface serial 2/0 R1(config-if)#ip ospf authentication /开启明文认证 R1(config-if)#ip ospf au

30、thentication-key 1 ccie /设置明文密码配置R1路由器 R2(config)#interface serial 2/0 R2(config-if)#ip ospf authentication R2(config-if)#ip ospf authentication-key 1 ccie实验验证R1#show ip ospf interface serial 2/0Serial2/0 is up, line protocol is up Internet Address 12.1.1.1/24, Area 0 Process ID 1, Router ID 1.1.1.1

31、, Network Type POINT_TO_POINT, Cost: 64 Transmit Delay is 1 sec, State POINT_TO_POINT, Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5 oob-resync timeout 40 Hello due in 00:00:09 Supports Link-local Signaling (LLS) Index 2/2, flood queue length 0 Next 0 x0(0)/0 x0(0) Last flood

32、scan length is 1, maximum is 1 Last flood scan time is 0 msec, maximum is 0 msec Neighbor Count is 1, Adjacent neighbor count is 1 Suppress hello for 0 neighbor(s) Simple password authentication enabled /简单口令认证5.3.4 基于接口的OSPF MD5认证配置R1路由器 R1(config)#interface serial 2/0 R1(config-if)#ip ospf authent

33、ication message-digest /开启密文认证 R1(config-if)#ip ospf message-digest-key 1 md5 ccie /设置MD5密码配置R1路由器 R2(config)#interface serial 2/0 R2(config-if)#ip ospf authentication message-digest R2(config-if)#ip ospf message-digest-key 1 md5 ccie 实验验证R1#show ip ospf interface s2/0Serial2/0 is up, line protocol

34、is up Internet Address 12.1.1.1/24, Area 0 Process ID 1, Router ID 1.1.1.1, Network Type POINT_TO_POINT, Cost: 64 Transmit Delay is 1 sec, State POINT_TO_POINT, Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5 oob-resync timeout 40 Hello due in 00:00:00 Supports Link-local Signal

35、ing (LLS) Index 2/2, flood queue length 0 Next 0 x0(0)/0 x0(0) Last flood scan length is 1, maximum is 1 Last flood scan time is 0 msec, maximum is 0 msec Neighbor Count is 1, Adjacent neighbor count is 1 Suppress hello for 0 neighbor(s) Message digest authentication enabled Youngest key id is 1 /MD

36、5认证方式5.3.4 MD5认证排错 如果R1和R2上都配置的密文认证,但key ID不一样,会出现的情况;在R1上配置了key id 2 ,在R2上配置了key ID 1,即使密码一样,也不会认证成功R1#debug ip os adjOSPF adjacency events debugging is onR1#01:11:57: OSPF: Send with youngest Key 201:11:57: OSPF: Rcv pkt from 12.1.1.2, Serial1 : Mismatch Authentication Key - No message digest key

37、1 on interfaceR2#01:15:14: OSPF: Rcv pkt from 12.1.1.1, Serial1 : Mismatch Authentication Key - No message digest key 2 on interface01:15:14: OSPF: Send with youngest Key 1此时在R1上增加一个key ID 1 ,认证会起来,R1(config-if)#ip ospf message-digest-key 1 md5 ciscoR1#01:17:36: OSPF: Send with youngest Key 1, /*总是发

38、”最年轻”的key与对方进行比较5.4 OSPF汇总 5.4.1 非0区域到骨干区域汇总实验拓扑实验步骤R1基本配置 interface Loopback0 interface Serial1 clockrate 64000 router ospf 1 network 12.1.1.0 0.0.0.3 area 0R2路由器基本配置interface Loopback0interface Loopback1interface Loopback2interface Loopback3interface Loopback4 ip address 100.26.26.49 255.255.255.2

39、40 interface Serial1router ospf 1network 12.1.1.0 0.0.0.3 area 0network 100.26.26.0 0.0.0.63 area 1(3)查看路由表R1#show ip route 1.0.0.0/32 is subnetted, 1 subnetsC 1.1.1.1 is directly connected, Loopback0 100.0.0.0/32 is subnetted, 4 subnetsO IA 100.26.26.33 110/65 via 12.1.1.2, 00:18:32, Serial1O IA 10

40、0.26.26.49 110/65 via 12.1.1.2, 00:18:32, Serial1O IA 100.26.26.1 110/65 via 12.1.1.2, 00:18:32, Serial1O IA 100.26.26.17 110/65 via 12.1.1.2, 00:18:32, Serial1 12.0.0.0/30 is subnetted, 1 subnetsC 12.1.1.0 is directly connected, Serial1(4)R2进行路由汇总(ABR)R2(config)#router ospf 1R2(config-router)#area

41、1 range 100.26.26.0 255.255.255.192 /注意区分掩码和区域查看汇总后的路由表R1#show ip route 1.0.0.0/32 is subnetted, 1 subnetsC 1.1.1.1 is directly connected, Loopback0 100.0.0.0/26 is subnetted, 1 subnetsO IA 100.26.26.0 110/65 via 12.1.1.2, 00:00:25, Serial1 /汇总后的路由表 12.0.0.0/30 is subnetted, 1 subnetsC 12.1.1.0 is d

42、irectly connected, Serial1 5.4.1 骨干区域到非0区域汇总实验拓扑实验步骤配置R1路由器nterface Loopback0interface Serial1 clockrate 64000router ospf 1network 12.1.1.0 0.0.0.3 area 1配置R2路由器interface Loopback0interface Loopback1interface Loopback2interface Loopback3interface Loopback4 ip address 100.26.26.49 255.255.255.240 int

43、erface Serial1router ospf 1network 12.1.1.0 0.0.0.3 area 1network 100.26.26.0 0.0.0.63 area 0查看路由表R1#show ip route 1.0.0.0/32 is subnetted, 1 subnetsC 1.1.1.1 is directly connected, Loopback0 100.0.0.0/32 is subnetted, 4 subnetsO IA 100.26.26.33 110/65 via 12.1.1.2, 00:04:16, Serial1O IA 100.26.26.4

44、9 110/65 via 12.1.1.2, 00:04:16, Serial1O IA 100.26.26.1 110/65 via 12.1.1.2, 00:04:16, Serial1O IA 100.26.26.17 110/65 via 12.1.1.2, 00:04:16, Serial1 12.0.0.0/30 is subnetted, 1 subnetsC 12.1.1.0 is directly connected, Serial1(4) 在R2进行路由汇总(ABR)R2(config)#router ospf 1R2(config-router)#area 0 range 100.26.26.0 255.255.255.192 /注意区分掩码和区域(5)查看汇总后的路由表R1#show ip route 1.0.0.0/32 is subnetted, 1 subnetsC 1.1.1.1 is directly connected, Loopback0 100.0.0.0/26 is subnetted, 1 subnetsO IA 100.26.26.0 110/65 via 12.1.1.2, 00:00:07

温馨提示

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

评论

0/150

提交评论