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

下载本文档

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

文档简介

计算机系 邹瑞源,计算机网络互联技术,ospf简介,ospf是一种典型的链路状态路由协议。采用ospf的路由器彼此交换并保存整个网络的链路信息,从而掌握全网的拓扑结构,独立计算路由。 ospf作为一种内部网关协议(interior gateway protocol,igp),用于在同一个自治域(as)中的路由器之间发布路由信息。区别于距离矢量协议(rip),ospf具有支持大型网络、路由收敛快、占用网络资源少等优点,在目前应用的路由协议中占有相当重要的地位。,ospf简介,开放的国际标准 shortest path first (spf最短路径优先) 算法 链路状态路由协议,ospf 概述,通过交换hello数据包来创建邻居关系 以传播lsa( link-state advertisements )代替路由表更新. 链路(link):路由器接口 状态(state):描述接口以及它与邻居路由器的关系 lsas 泛洪到区域中的所有ospf路由器,而不仅仅是直连路由器 收集由ospf路由器生成的所有lsa以创建ospf链路状态数据库. 使用spf算法计算到每个目的地的最短距离,并将其置于路由表中.,ospf术语,shortest path first algorithm,将每台路由器放置在树的根节点,并根据累计开销计算到达每个目的地的最短路径 开销(cost) = 参考带宽(108)/接口带宽 (bps),ospf特点详介,ospfopen shortest path first 使用cost(成本)作为其路由度量值,其默认成本基于介质的传输带宽来度量,ospf特点详介,三大优越性: 1、收敛时间快 2、支持vlsm和cidr 3、网络的扩展性强 对跳数基本没有限制,对于跳数过多的网络可通过层次化的设计,将达的ospf网络化分成小的、易管理的ospf域,ospf 层级示列,区域和自治系统 尽量减少路由表条目 使拓扑变化仅影响本区域内部,ospf数据包类型(ospf packet types),ospf 的五种分组类型,类型1,问候(hello)分组。 类型2,数据库描述(database description)分组。 类型3,链路状态请求(link state request)分组。 类型4,链路状态更新(link state update)分组, 用洪泛法对全网更新链路状态。 类型5,链路状态确认(link state acknowledgment) 分组。,ospf操作,1. 建立邻接关系 2. 必要的进行dr选举 3. 发现路由 4. 选择相应的路由 5. 维护路由信息,建立邻接关系,*标记的在邻居路由器上必须匹配,ospf网络类型,frame relay x.25,广播broadcast multiaccess,非广播nonbroadcast multiaccess,点到点point-to-point,点到多点point-to-multipoint,点到点链路(point-to-point links),不进行dr选举 ospf自动检测这种接口类型,广播型多路访问网络,进行dr选举 邻居只与dr和dbr形成邻接关系,必要时进行dr选举,dr与bdr的选举取决于路由器的优先级 可通过接口配置模式 ip ospf priority 命令修改该路由器的优先级 如果优先级相同,则比较router id。 router id: 默认值:ospf过程启动时活动接口上的最高ip地址 可以使用环回接口覆盖:环回接口的最高ip地址(次优先) 可以使用router-id命令手动设置(最优先),选举dr和bdr,最高接口优先级的路由器被选成dr 最高路由器id的路由器被选举成dr dr选举不具有抢占性,建立双向通信,建立双向通信,建立双向通信,建立双向通信,查找网络路由,查找网络路由,增加链路状态条目,增加链路状态条目,增加链路状态条目,维护路由信息,路由器用224.0.0.6通知dr,维护路由信息,dr利用组播地址224.0.0.5通知其它路由器,维护路由信息,维护路由信息,配置单区域的ospf,router(config-router)# network address wildcard-mask area area-id,将网络分配到ospf 区域,router(config)# router ospf process-id,将 ospf定义为 ip 路由协议,ospf 配置示列,ospf配置实例,验证ospf 配置,router# show ip protocols,检验是否已配置ospf,router# show ip route,显示路由器所学习到的所有路由,router# show ip route codes: i - igrp derived, r - rip derived, o - ospf derived, 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.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 . . .,router# show ip ospf,验证ospf 配置,显示ospf路由器、计时器和统计信息,router# show ip ospf routing 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 not originating router-lsas with maximum metric initial spf schedule delay 5000 msecs area 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 ,router# 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, 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 count is 2 adjacent with neighbor 192.168.254.28 (backup designated router) adjacent with neighbor 192.168.254.10 (designated router),验证ospf 配置,router# show ip ospf neighbor,显示每个接口上的ospf邻居信息,router# show ip ospf neighbor id pri state dead time address 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,验证ospf 配置,router# 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 172.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 gigabitethernet1/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 0x42 lls options is 0x1 (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 first 0x0(0)/0x0(0) next 0x0(0)/0x0(0) last retransmission scan length is 1, maximum is 1 last retransmission scan time is 0 msec, maximum is 0 msec,ospf 调试命令,router# debug ip ospf events ospf:hello with invalid timers on interface ethernet0 hello interval received 10 configured 10 net mask received 255.255.255.0 configured 255.255.255.0 dead interval received 40 configured 30 router# 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.0.0.0 chk:0 aut:2 keyid:1 seq:0x0,实验环境,a,b,192.168.1.64/27,192.168.1.32/27,192.168.1.104/29,ospf的基本配置,router_a#config terminal router_a(config)# router_a(config)#router ospf 1 /启动ospf协议,其进程为1 router_a(config-router)#network 192.168.1.32 0.0.0.31 area 0 router_a(config-router)#network 192.168.1.64 0.0.0.31 area 0,router_b#config terminal router_b(config)# router_b(config)#router ospf 1 /启动ospf协议,其进程为1 router_b(config-router)#network 192.168.1.32 0.0.0.31 area 0 router_b(config-router)#network 192.168.1.104 0.0.0.7 area 0,ospf身份验证,ospf支持以下几种类型的身份验证: -空(无身份验证) -明文(或简单)口令身份验证 -md5身份验证 路由器生成并检查每个ospf数据包。 路由器验证接收到的每个路由更新数据包的来源。 配置“密钥”(口令):每个参与的邻居都必须配置相同的密钥。,配置ospf身份验证,步骤一:设定验证的口令 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个字符),配置ospf身份验证,步骤二:启用ospf身份验证并指定验证类型 方法1:在接口上直接指定(12.0版本以上提供) router(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加密口令,使用ospf配置负载均衡,ospf负载均衡 路径必须为等价路径 默认情况下,最多可在路由表中加入4条等价路径 通过更改配置,最多可以配置16条等价路径 -(config-router)# maximum-paths 可更改链路的开销以确保路径等价进行负载均衡 -(config-if)# ip ospf cost ,修改链路成本,router# router#config terminal router(config)#interface f0/0 router(config-if)#ip ospf cost number /number为1到65535之间的值,internet互联网,局域网: 内部使用ospf 接入互联网使用默认路由 内部计算机如何使用默认路由?,?,默认路由,默认路由发布到ospf区域,将默认路由发布到ospf区域中,使用以下命令: router(config-router)# default-information originate,课堂作业,e0,e0,s0,s0,思考题(questions),1. ospf是一种典型的_路由协议。 2. ospf路由协议的管理距离是_。 3. ospf路由协议采用_作为度量标准。 4. ospf路由器利用_算法,独立地计算出到达任意目的地的路由。 5. 默认情况下,快速以太网的开销是_。 6. ospf将网络划分为四种类型:_、_、_、_。 7. ethernet的hello interval为_秒,dead interval为_秒。 8. nbma网络的hello int

温馨提示

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

评论

0/150

提交评论