路由ospf的配置_第1页
路由ospf的配置_第2页
路由ospf的配置_第3页
路由ospf的配置_第4页
路由ospf的配置_第5页
已阅读5页,还剩52页未读 继续免费阅读

下载本文档

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

文档简介

1、it education & trainingdate: 24 october 2021计算机系 邹瑞源计算机网络互联技术 it education & trainingdate: 24 october 2021 ospf简介 ospf是一种典型的链路状态路由协议。采用ospf的路由器彼此交换并保存整个网络的链路信息,从而掌握全网的拓扑结构,独立计算路由。 ospf作为一种内部网关协议(interior gateway protocol,igp),用于在同一个自治域(as)中的路由器之间发布路由信息。区别于距离矢量协议(rip),ospf具有支持大型网络、路由收敛快、占用网络资

2、源少等优点,在目前应用的路由协议中占有相当重要的地位。it education & trainingdate: 24 october 2021ospf简介开放的国际标准开放的国际标准shortest path first (spf最短路径优先最短路径优先) 算法算法链路状态路由协议链路状态路由协议it education & trainingdate: 24 october 2021ospf 概述 通过交换hello数据包来创建邻居关系 以传播lsa( link-state advertisements )代替路由表更新. 链路(link):路由器接口 状态(state):描述

3、接口以及它与邻居路由器的关系 lsas 泛洪到区域中的所有ospf路由器,而不仅仅是直连路由器 收集由ospf路由器生成的所有lsa以创建ospf链路状态数据库. 使用spf算法计算到每个目的地的最短距离,并将其置于路由表中.it education & trainingdate: 24 october 2021ospf术语it education & trainingdate: 24 october 2021shortest path first algorithm 将每台路由器放置在树的根节点,并根据累计开销计算到将每台路由器放置在树的根节点,并根据累计开销计算到达每个目的

4、地的最短路径达每个目的地的最短路径 开销(开销(cost) = 参考带宽(参考带宽(108)/接口带宽接口带宽 (bps)it education & trainingdate: 24 october 2021ospf特点详介特点详介ospfopen shortest path first 使用cost(成本)作为其路由度量值,其默认成本基于介质的传输带宽来度量it education & trainingdate: 24 october 2021ospf特点详介特点详介三大优越性: 1、收敛时间快 2、支持vlsm和cidr 3、网络的扩展性强 对跳数基本没有限制,对于跳数过

5、多的网络可通过层次化的设计,将达的ospf网络化分成小的、易管理的ospf域it education & trainingdate: 24 october 2021ospf 层级示列 区域和自治系统区域和自治系统 尽量减少路由表条目尽量减少路由表条目 使拓扑变化仅影响本区域内部使拓扑变化仅影响本区域内部it education & trainingdate: 24 october 2021ospf数据包类型(ospf packet types)it education & trainingdate: 24 october 2021 ospf 的五种分组类型 类型类型1,

6、问候,问候(hello)分组。分组。类型类型2,数据库描述,数据库描述(database description)分组。分组。类型类型3,链路状态请求,链路状态请求(link state request)分组。分组。类型类型4,链路状态更新,链路状态更新(link state update)分组,分组, 用洪泛法对全网更新链路状态。用洪泛法对全网更新链路状态。类型类型5,链路状态确认,链路状态确认(link state acknowledgment) 分组。分组。 it education & trainingdate: 24 october 2021ospf操作操作 1. 建立邻接关

7、系2. 必要的进行dr选举3. 发现路由4. 选择相应的路由5. 维护路由信息it education & trainingdate: 24 october 2021建立邻接关系建立邻接关系*标记的在邻居路由器上必须匹配标记的在邻居路由器上必须匹配it education & trainingdate: 24 october 2021ospf网络类型network typenetwork typecharacteristicscharacteristicsdr/bdr elected?dr/bdr elected?以太网(以太网(ethernetethernet)yes帧中继(

8、帧中继(frame relayframe relay)yesppp, hdlcppp, hdlcno管理员用子接口配置(管理员用子接口配置(configured by administrator configured by administrator with subinterfaceswith subinterfaces)noframe relayx.25广播broadcast multiaccess非广播nonbroadcast multiaccess点到点point-to-point点到多点point-to-multipointit education & trainingdat

9、e: 24 october 2021点到点链路(point-to-point links)不进行dr选举ospf自动检测这种接口类型it education & trainingdate: 24 october 2021广播型多路访问网络进行dr选举邻居只与dr和dbr形成邻接关系it education & trainingdate: 24 october 2021必要时进行dr选举 dr与bdr的选举取决于路由器的优先级 可通过接口配置模式 ip ospf priority 命令修改该路由器的优先级 如果优先级相同,则比较router id。 router id: 默认值:

10、ospf过程启动时活动接口上的最高ip地址 可以使用环回接口覆盖:环回接口的最高ip地址(次优先) 可以使用router-id命令手动设置(最优先)it education & trainingdate: 24 october 2021选举dr和bdr最高接口优先级的路由器被选成dr最高路由器id的路由器被选举成drdr选举不具有抢占性it education & trainingdate: 24 october 2021建立双向通信建立双向通信it education & trainingdate: 24 october 2021建立双向通信it education

11、& trainingdate: 24 october 2021建立双向通信it education & trainingdate: 24 october 2021建立双向通信it education & trainingdate: 24 october 2021查找网络路由it education & trainingdate: 24 october 2021查找网络路由it education & trainingdate: 24 october 2021增加链路状态条目it education & trainingdate: 24 octob

12、er 2021增加链路状态条目it education & trainingdate: 24 october 2021增加链路状态条目it education & trainingdate: 24 october 2021维护路由信息路由器用路由器用224.0.0.6通知通知dr it education & trainingdate: 24 october 2021维护路由信息dr利用组播地址利用组播地址224.0.0.5通知其它路由器通知其它路由器it education & trainingdate: 24 october 2021维护路由信息it edu

13、cation & trainingdate: 24 october 2021维护路由信息it education & trainingdate: 24 october 2021配置单区域的ospfrouter(config-router)# network address wildcard-mask area area-id 将网络分配到将网络分配到ospf 区域区域router(config)# router ospf process-id 将将 ospf定义为定义为 ip 路由协议路由协议it education & trainingdate: 24 october

14、 2021ospf 配置示列it education & trainingdate: 24 october 2021ospf配置实例it education & trainingdate: 24 october 2021验证ospf 配置router# show ip protocols 检验是否已配置检验是否已配置ospfrouter# show ip route 显示路由器所学习到的所有路由显示路由器所学习到的所有路由router# show ip routecodes: i - igrp derived, r - rip derived, o - ospf derived

15、, c - connected, s - static, e - egp derived, b - bgp derived, e2 - ospf external type 2 route, n1 - ospf nssa external type 1 route, n2 - ospf nssa external type 2 route gateway of last resort is 10.119.254.240 to network 10.140.0.0 o e2 10.110.0.0 160/5 via 10.119.254.6, 0:01:00, ethernet2 e 10.67

16、.10.0 200/128 via 10.119.254.244, 0:02:22, ethernet2 o e2 10.68.132.0 160/5 via 10.119.254.6, 0:00:59, ethernet2 o e2 10.130.0.0 160/5 via 10.119.254.6, 0:00:59, ethernet2 e 10.128.0.0 200/128 via 10.119.254.244, 0:02:22, ethernet2 . . .it education & trainingdate: 24 october 2021router# show ip

17、 ospf验证ospf 配置 显示显示ospf路由器、计时器和统计信息路由器、计时器和统计信息router# show ip ospfrouting process ospf 1 with id 172.16.6.1 start time: 00:38:41.540, time elapsed: 00:00:25.860 supports only single tos(tos0) routes supports opaque lsa supports link-local signaling (lls) supports area transit capability router is n

18、ot originating router-lsas with maximum metric initial spf schedule delay 5000 msecsarea backbone(0) (inactive) number of interfaces in this area is 1 area has no authentication spf algorithm last executed 00:00:07.368 ago spf algorithm executed 1 times.it education & trainingdate: 24 october 20

19、21router# show ip ospf interface验证ospf 配置 显示区域显示区域 id 和邻接信息和邻接信息router# show ip ospf interface ethernet 0 ethernet 0 is up, line protocol is up internet address 192.168.254.202, mask 255.255.255.0, area 0.0.0.0 as 201, router id 192.168.99.1, network type broadcast, cost: 10 transmit delay is 1 sec,

20、 state other, priority 1 designated router id 192.168.254.10, interface address 192.168.254.10 backup designated router id 192.168.254.28, interface addr 192.168.254.28 timer intervals configured, hello 10, dead 60, wait 40, retransmit 5 hello due in 0:00:05 neighbor count is 8, adjacent neighbor co

21、unt is 2 adjacent with neighbor 192.168.254.28 (backup designated router) adjacent with neighbor 192.168.254.10 (designated router) it education & trainingdate: 24 october 2021验证ospf 配置router# show ip ospf neighbor显示每个接口上的显示每个接口上的ospf邻居信息邻居信息router# show ip ospf neighbor id pri state dead time a

22、ddress interface 10.199.199.137 1 full/dr 0:00:31 192.168.80.37 ethernet0 172.16.48.1 1 full/drother 0:00:33 172.16.48.1 fddi0 172.16.48.200 1 full/drother 0:00:33 172.16.48.200 fddi0 10.199.199.137 5 full/dr 0:00:33 172.16.48.189 fddi0 it education & trainingdate: 24 october 2021验证ospf 配置router

23、# show ip ospf neighbor 10.199.199.137 neighbor 10.199.199.137, interface address 192.168.80.37 in the area 0.0.0.0 via interface ethernet0 neighbor priority is 1, state is full options 2 dead timer due in 0:00:32 link state retransmission due in 0:00:04 neighbor 10.199.199.137, interface address 17

24、2.16.48.189 in the area 0.0.0.0 via interface fddi0 neighbor priority is 5, state is full options 2 dead timer due in 0:00:32 link state retransmission due in 0:00:03 router# show ip ospf neighbor detail neighbor 192.168.5.2, interface address 10.225.200.28 in the area 0 via interface gigabitetherne

25、t1/0/0 neighbor priority is 1, state is full, 6 state changes dr is 10.225.200.28 bdr is 10.225.200.30 options is 0 x42 lls options is 0 x1 (lr), last oob-resync 00:03:08 ago dead timer due in 00:00:36 neighbor is up for 00:09:46 index 1/1, retransmission queue length 0, number of retransmission 1 f

26、irst 0 x0(0)/0 x0(0) next 0 x0(0)/0 x0(0) last retransmission scan length is 1, maximum is 1 last retransmission scan time is 0 msec, maximum is 0 msec it education & trainingdate: 24 october 2021ospf 调试命令router# debug ip ospf eventsospf:hello with invalid timers on interface ethernet0hello inte

27、rval received 10 configured 10net mask received 255.255.255.0 configured 255.255.255.0dead interval received 40 configured 30router# debug ip ospf packet ospf: rcv. v:2 t:1 l:48 rid:200.0.0.117 aid:0.0.0.0 chk:6ab2 aut:0 auk: router# debug ip ospf packet ospf: rcv. v:2 t:1 l:48 rid:200.0.0.116 aid:0

28、.0.0.0 chk:0 aut:2 keyid:1 seq:0 x0it education & trainingdate: 24 october 2021实验环境ab192.168.1.64/27192.168.1.32/27192.168.1.104/29it education & trainingdate: 24 october 2021ospf的基本配置router_a#config terminalrouter_a(config)#router_a(config)#router ospf 1 /启动ospf协议,其进程为1 router_a(config-rout

29、er)#network 192.168.1.32 0.0.0.31 area 0router_a(config-router)#network 192.168.1.64 0.0.0.31 area 0it education & trainingdate: 24 october 2021router_b#config terminalrouter_b(config)#router_b(config)#router ospf 1 /启动ospf协议,其进程为1 router_b(config-router)#network 192.168.1.32 0.0.0.31 area 0rout

30、er_b(config-router)#network 192.168.1.104 0.0.0.7 area 0it education & trainingdate: 24 october 2021ospf身份验证 ospf支持以下几种类型的身份验证: -空(无身份验证) -明文(或简单)口令身份验证 -md5身份验证 路由器生成并检查每个ospf数据包。 路由器验证接收到的每个路由更新数据包的来源。 配置“密钥”(口令):每个参与的邻居都必须配置相同的密钥。it education & trainingdate: 24 october 2021配置ospf身份验证步骤一:设

31、定验证的口令 1、设定明文口令 router(config-if)# ip ospf authentication-key password 分配用于邻居路由器的口令(最长8个字符) 2、设定md5加密的口令 router(config-if)# ip ospf message-digest-key id md5 password 分配用于邻居路由器的口令(md5加密,最长16个字符)it education & trainingdate: 24 october 2021配置ospf身份验证步骤二:启用ospf身份验证并指定验证类型 方法1:在接口上直接指定(12.0版本以上提供) r

32、outer(config-if)# ip ospf authentication message-digest | null 指定接口的身份验证类型 message-digest :md5加密口令 null :空口令 方法2:整个ospf 区域指定验证类型 router(config-router)# area area-id authentication message-digest message-digest :md5加密口令it education & trainingdate: 24 october 2021使用ospf配置负载均衡ospf负载均衡 路径必须为等价路径 默认情

33、况下,最多可在路由表中加入4条等价路径 通过更改配置,最多可以配置16条等价路径 -(config-router)# maximum-paths 可更改链路的开销以确保路径等价进行负载均衡 -(config-if)# ip ospf cost it education & trainingdate: 24 october 2021修改链路成本router#router#config terminalrouter(config)#interface f0/0router(config-if)#ip ospf cost number/number为为1到到65535之间的值之间的值it e

34、ducation & trainingdate: 24 october 2021internet互联网局域网:内部使用ospf接入互联网使用默认路由内部计算机如何使用默认路由?默认路由it education & trainingdate: 24 october 2021默认路由发布到ospf区域 将默认路由发布到ospf区域中,使用以下命令: router(config-router)# default-information originateit education & trainingdate: 24 october 2021课堂作业e0e0s0s0it education & trainingdate: 24 october 2021思考题(questions)1. ospf是一种典型的_路由协议。2. ospf路由协议的管理距离是_。3. ospf路由协议采用_作为度量标准。4. ospf路由器利用_算法,独立地计算出到达任意目的地的路由。5. 默认情况下,快速以太网的开销是_。6. ospf将网络划分为四种类型:_、_、_、_。7. ethernet的hello interval为_秒,dead interval为_秒。8. nbma网络的hello interval_秒,dead interva

温馨提示

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

评论

0/150

提交评论