《单区域 ospf 实施》由会员分享,可在线阅读,更多相关《单区域 ospf 实施(21页珍藏版)》请在金锄头文库上搜索。
1、 2008 Cisco Systems, Inc. 保留所有权利。ICND2 v1.04-1单区域 OSPF 实施实施 OSPF 2008 Cisco Systems, Inc. 保留所有权利。ICND2 v1.04-2OSPF 概述 通过交换 hello 数据包来创建邻居关系 以传播 LSA 代替路由表更新 链路:路由器接口 状态:描述接口以及它与邻居路由器的关系 将 LSA 泛洪到区域中的所有 OSPF 路由器,而不仅是直连的路由器 收集由 OSPF 路由器生成的所有 LSA 以创建 OSPF 链路状态数据库 使用 SPF 算法计算到每个目的地的最短距离,并将其置于路由表中 2008 Ci
2、sco Systems, Inc. 保留所有权利。ICND2 v1.04-3OSPF 层级示例尽量减少路由表条目 使拓扑变化仅影响本区域内部 2008 Cisco Systems, Inc. 保留所有权利。ICND2 v1.04-4邻居关系:Hello 数据包 2008 Cisco Systems, Inc. 保留所有权利。ICND2 v1.04-5SPF 算法 将每台路由器放置在树的根节点 ,并根据累计开销计算到达每个 目的地的最短路径 开销 = 参考带宽 / 接口带宽 (b/s) 2008 Cisco Systems, Inc. 保留所有权利。ICND2 v1.04-6配置单区域 OSPF
3、network address wildcard-mask area area-id 将网络分配到指定 OSPF 区域router ospf process-id 将 OSPF 定义为 IP 路由协议RouterX(config)#RouterX(config-router)# 2008 Cisco Systems, Inc. 保留所有权利。ICND2 v1.04-7配置环回接口 路由器 ID:按照 OSPF 了解的路由器进行编号 默认值:OSPF 过程启动时活动接口上的最高 IP 地址 可以使用环回接口覆盖:任何活动环回接口上的最高 IP 地址 可以使用 router-id 命令手动设置 2
4、008 Cisco Systems, Inc. 保留所有权利。ICND2 v1.04-8检验 OSPF 的配置RouterX# show ip protocols 检验是否已配置 OSPFRouterX# show ip route 显示路由器获知的所有路由RouterX# show ip routeCodes:I - IGRP derived, R - RIP derived, O - OSPF derived, C - connected, S - static, E - EGP derived, B - BGP derived, E2 - OSPF external type 2 rou
5、te, 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 10.110.0.0 110/5 via 10.119.254.6, 0:01:00, Ethernet2 O IA 10.67.10.0 110/10 via 10.119.254.244, 0:02:22, Ethernet2 O 10.68.132.0 110/5 via 10.119.254.6, 0:
6、00:59, Ethernet2 O 10.130.0.0 110/5 via 10.119.254.6, 0:00:59, Ethernet2 O E2 10.128.0.0 170/10 via 10.119.254.244, 0:02:22, Ethernet2 . . . 2008 Cisco Systems, Inc. 保留所有权利。ICND2 v1.04-9检验 OSPF 的配置(续)RouterX# show ip ospfRouting Process “ospf 50“ with ID 10.64.0.2 Number of areas in this router is 1
7、. 1 normal 0 stub 0 nssaNumber of areas transit capable is 0External flood list length 0Area BACKBONE(0)Area BACKBONE(0)Area has no authenticationSPF algorithm last executed 00:01:25.028 agoSPF algorithm executed 7 times 显示 OSPF 路由器 ID、计时器和统计信息RouterX# show ip ospf 2008 Cisco Systems, Inc. 保留所有权利。IC
8、ND2 v1.04-10RouterX# show ip ospf interface ethernet 0/0 Ethernet0/0 is up, line protocol is upInternet Address 192.168.1.2/24, Area 24Process ID 201, Router ID 192.168.1.2, Network Type BROADCAST, Cost: 10Transmit Delay is 1 sec, State DR, Priority 255Designated Router (ID) 192.168.1.2, Interface a
9、ddress 192.168.1.2Backup Designated router (ID) 4.4.4.4, Interface address 192.168.1.4Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5oob-resync timeout 40Hello due in 00:00:08Supports Link-local Signaling (LLS)Cisco NSF helper support enabledIETF NSF helper support enabledIndex
10、1/3, flood queue length 0Next 0x0(0)/0x0(0)Last flood scan length is 2, maximum is 2Last flood scan time is 0 msec, maximum is 0 msecNeighbor Count is 1, Adjacent neighbor count is 1Adjacent with neighbor 4.4.4.4 (Backup Designated RouterSuppress hello for 0 neighbor(s)RouterX# show ip ospf interfac
11、e检验 OSPF 的配置(续) 显示区域 ID 和邻接信息 2008 Cisco Systems, Inc. 保留所有权利。ICND2 v1.04-11RouterX# show ip ospf neighbor IDPri State Dead Time Address Interface 10.199.199.137 1 FULL/DR 0:00:31 192.168.80.37 FastEthernet0/0 172.16.48.1 1 FULL/DROTHER 0:00:33 172.16.48.1 FastEthernet0/1 172.16.48.200 1 FULL/DROTHE
12、R 0:00:33 172.16.48.200 FastEthernet0/1 10.199.199.137 5 FULL/DR 0:00:33 172.16.48.189 FastEthernet0/1 检验 OSPF 的配置(续)RouterX# show ip ospf neighbor 显示每个接口上的 OSPF 邻居信息 2008 Cisco Systems, Inc. 保留所有权利。ICND2 v1.04-12RouterX# show ip ospf neighbor 10.199.199.137 Neighbor 10.199.199.137, interface addres
13、s 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, Stat
14、e is FULL Options 2 Dead timer due in 0:00:32 Link State retransmission due in 00:00:03 检验 OSPF 的配置(续) 2008 Cisco Systems, Inc. 保留所有权利。ICND2 v1.04-13RouterX# debug ip ospf eventsOSPF:hello with invalid timers on interface Ethernet0 hello interval received 10 configured 10 net mask received 255.255.2
15、55.0 configured 255.255.255.0 dead interval received 40 configured 30OSPF:rcv. v:2 t:1 l:48 rid:200.0.0.117aid:0.0.0.0 chk:6AB2 aut:0 auk:RouterX# debug ip ospf packetOSPF:rcv. v:2 t:1 l:48 rid:200.0.0.116 aid:0.0.0.0 chk:0 aut:2 keyid:1 seq:0x0OSPF 调试命令 2008 Cisco Systems, Inc. 保留所有权利。ICND2 v1.04-1
16、4使用 OSPF 配置负载均衡 OSPF 负载均衡: 路径必须为等价路径 默认情况下,最多可在路由表中加入四条等价路径 通过更改配置,最多可以配置 16 条路径: (config-router)# maximum-paths 可更改特殊链路的开销以确保路径等价于负载均衡: (config-if)# ip ospf cost 2008 Cisco Systems, Inc. 保留所有权利。ICND2 v1.04-15使用 OSPF 配置负载均衡(续) 2008 Cisco Systems, Inc. 保留所有权利。ICND2 v1.04-16OSPF 身份验证 OSPF 支持以下几种类型的身份验证: 空(无身份验证) 明文(或简单)口令身份验证 MD5