IP : 开放最短路径优先 (OSPF)

OSPF Type-5路由计算配置示例

2015 年 8 月 28 日 - 机器翻译
其他版本: PDFpdf | 英语 (2015 年 4 月 23 日) | 反馈

简介

本文描述开放最短路径优先(OSPF)林克状态广告(LSA)类型5外部路由选择机制。它提交与配置的一网络环境如何的能选择从一自治系统边界路由器接收的路由(ASBR)在别的。

贡献用Naveen Bansal和Rahul Kukreja, Cisco TAC工程师

先决条件

要求

思科建议您有OSPF和IP路由知识。

使用的组件

本文档不限于特定的软件和硬件版本。

本文档中的信息都是基于特定实验室环境中的设备编写的。本文档中使用的所有设备最初均采用原始(默认)配置。如果您使用的是真实网络,请确保您已经了解所有命令的潜在影响。

背景信息

如果再分布路由到OSPF从其他路由协议或从静态,造成这些路由变为OSPF外部路由。 外部路由属于两个类别、外部类型1 (O E1)和外部类型2 (O E2)。

两个之间的差异就象开销的(量度)路由计算。类型 2 路由的成本始终为外部成本,与到达该路由的内部成本无关。类型 1 成本是用于到达该路由的外部成本和内部成本之和。对于同一目标,类型 1 路由始终优先于类型 2 路由。

配置

网络图

考虑此网络拓扑检查在起源于ASBRs于区域1. R2和R3是区域边界路由器的Area 0的R4 5接收的LSA类型(ABR)。

配置

为了简化,此配置再分布在ASBRs的静态路由在区域1路由器R5和R1。

R5#

ip route 192.168.1.1 255.255.255.255 Null0

router ospf 1
重新分配静态子网
网络10.5.5.5 0.0.0.0地区1
网络10.10.25.5 0.0.0.0地区1

R1-

ip route 192.168.1.1 255.255.255.255 Null0

router ospf 1
重新分配静态子网
网络10.1.1.1 0.0.0.0地区1
网络10.10.13.1 0.0.0.0地区1

注意: 如果量度没有指定, OSPF放置默认值为20,当再分布从所有协议的路由除了边界网关协议(BGP)路由时,接收量度1。 当有是已进行子网划分的主网时,您必须使用关键字子网为了重新分配协议到OSPF。如果不使用这个关键字,OSPF 将只再分配没有划分子网的主网。

验证

您能使用这些命令为了验证再分配:

R5#show ip ospf
Routing Process "ospf 1" with ID 10.5.5.5
Start time: 00:06:18.188, Time elapsed: 00:26:04.176
Supports only single TOS(TOS0) routes
Supports opaque LSA
Supports Link-local Signaling (LLS)
Supports area transit capability
Supports NSSA (compatible with RFC 3101)
Event-log enabled, Maximum number of events: 1000, Mode: cyclic
It is an autonomous system boundary router
Redistributing External Routes from,
  static, includes subnets in redistribution
Router is not originating router-LSAs with maximum metric
Initial SPF schedule delay 5000 msecs
Minimum hold time between two consecutive SPFs 10000 msecs
Maximum wait time between two consecutive SPFs 10000 msecs
Incremental-SPF disabled
Minimum LSA interval 5 secs
Minimum LSA arrival 1000 msecs
LSA group pacing timer 240 secs
Interface flood pacing timer 33 msecs
Retransmission pacing timer 66 msecs
Number of external LSA 2. Checksum Sum 0x010F34
Number of opaque AS LSA 0. Checksum Sum 0x000000
Number of DCbitless external and opaque AS LSA 0
Number of DoNotAge external and opaque AS LSA 0
Number of areas in this router is 1. 1 normal 0 stub 0 nssa
Number of areas transit capable is 0
External flood list length 0
IETF NSF helper support enabled
Cisco NSF helper support enabled
Reference bandwidth unit is 100 mbps
Area 1
Number of interfaces in this area is 2 (1 loopback)
Area has no authentication
SPF algorithm last executed 00:22:45.848 ago
SPF algorithm executed 2 times
Area ranges are
Number of LSA 11. Checksum Sum 0x03C19D
Number of opaque link LSA 0. Checksum Sum 0x000000
Number of DCbitless LSA 0
Number of indication LSA 0
Number of DoNotAge LSA 0
Flood list length 0
R1#show ip ospf
Routing Process "ospf 1" with ID 10.1.1.1
Start time: 00:07:09.376, Time elapsed: 00:27:30.368
Supports only single TOS(TOS0) routes
Supports opaque LSA
Supports Link-local Signaling (LLS)
Supports area transit capability
Supports NSSA (compatible with RFC 3101)
Event-log enabled, Maximum number of events: 1000, Mode: cyclic
It is an autonomous system boundary router
Redistributing External Routes from,
  static, includes subnets in redistribution
Router is not originating router-LSAs with maximum metric
Initial SPF schedule delay 5000 msecs
Minimum hold time between two consecutive SPFs 10000 msecs
Maximum wait time between two consecutive SPFs 10000 msecs
Incremental-SPF disabled
Minimum LSA interval 5 secs
Minimum LSA arrival 1000 msecs
LSA group pacing timer 240 secs
Interface flood pacing timer 33 msecs
Retransmission pacing timer 66 msecs
Number of external LSA 2. Checksum Sum 0x010F34
Number of opaque AS LSA 0. Checksum Sum 0x000000
Number of DCbitless external and opaque AS LSA 0
Number of DoNotAge external and opaque AS LSA 0
Number of areas in this router is 1. 1 normal 0 stub 0 nssa
Number of areas transit capable is 0
External flood list length 0
IETF NSF helper support enabled
Cisco NSF helper support enabled
Reference bandwidth unit is 100 mbps
Area 1
Number of interfaces in this area is 2 (1 loopback)
Area has no authentication
SPF algorithm last executed 00:24:42.268 ago
SPF algorithm executed 2 times
Area ranges are
Number of LSA 11. Checksum Sum 0x076A33
Number of opaque link LSA 0. Checksum Sum 0x000000
Number of DCbitless LSA 0
Number of indication LSA 0
Number of DoNotAge LSA 0
Flood list length 0

因此从两个ASBR路由器, R5和R1再分布静态路由。为了检查在路由器R4的被重新分配的路由前缀192.168.1.1/32,请输入此命令:

R4#show ip route 192.168.1.1 255.255.255.255
Routing entry for 192.168.1.1/32
Known via "ospf 1", distance 110, metric 20, type extern 2, forward metric 2
Last update from 10.10.24.2 on FastEthernet0/0, 00:25:43 ago
Routing Descriptor Blocks:
  * 10.10.34.3, from 10.1.1.1, 00:26:44 ago, via FastEthernet0/1
    Route metric is 20, traffic share count is 1
    10.10.24.2, from 10.5.5.5, 00:25:43 ago, via FastEthernet0/0
    Route metric is 20, traffic share count is 1

这显示两个路由起源于10.1.1.1 (R1),并且10.5.5.5 (R5)在与量度20的路由表里安装。

这可能也被登记OSPF数据库:

当路由再分布到OSPF时,默认情况下如前面提到,度量值设置到20。其次,请定义值10,当您在ASBR 10.1.1.1 (R1)时重新分配并且检查在Router4的输出。

这是在R1实现的更改:

R1(config)#router ospf 1
R1(config-router)#redistribute static subnets metric 10

这是在R4的路由表:

R4#show ip route 192.168.1.1 255.255.255.255

Routing entry for 192.168.1.1/32
Known via "ospf 1", distance 110, metric 10, type extern 2, forward metric 2
Last update from 10.10.34.3 on FastEthernet0/1, 00:00:09 ago
Routing Descriptor Blocks:
  * 10.10.34.3, from 10.1.1.1, 00:00:09 ago, via FastEthernet0/1
      Route metric is 10, traffic share count is 1

只有一个条目在路由表里。进一步检查OSPF数据库此外部LSA。

转发量度

向前量度是到达从路由器的ASBR的开销。这可以用这些命令检查

R4#show ip ospf border-routers
OSPF Router with ID (10.4.4.4) (Process ID 1)

Base Topology (MTID 0)
Internal Router Routing Table
Codes: i - Intra-area route, I - Inter-area route

i 10.3.3.3 [1] via 10.10.34.3, FastEthernet0/1, ABR, Area 0, SPF 3
I 10.1.1.1 [2] via 10.10.34.3, FastEthernet0/1, ASBR, Area 0, SPF 3
i 10.2.2.2 [1] via 10.10.24.2, FastEthernet0/0, ABR, Area 0, SPF 3
I 10.5.5.5 [2] via 10.10.24.2, FastEthernet0/0, ASBR, Area 0, SPF 3

在此输出中,到达ASBRs的开销(R1和R5)是2从路由器R4。默认情况下,快速以太网接口的开销在OSPF是1。 那么在这种情况下,开销是2从到达R1或R5的R4 :到达ABR的向前量度=路由器开销(1) +到达ASBR的ABR开销(1) = 2。

更改再分配量度到10在R5,因此两个路由在路由表再安装。

这是在R1实现的更改:

R5(config)#router ospf 1
R5(config-router)#redistribute static subnets metric 10

这是在R4的路由表:

R4#show ip route 192.168.1.1 255.255.255.255
Routing entry for 192.168.1.1/32
Known via "ospf 1", distance 110, metric 10, type extern 2, forward metric 2
Last update from 10.10.24.2 on FastEthernet0/0, 00:00:12 ago
Routing Descriptor Blocks:
   * 10.10.34.3, from 10.1.1.1, 00:12:05 ago, via FastEthernet0/1
     Route metric is 10, traffic share count is 1
     10.10.24.2, from 10.5.5.5, 00:00:12 ago, via FastEthernet0/0
     Route metric is 10, traffic share count is 1

更改开销到达一ASBRs,但是与同样再分配量度和检查同一输出。

增加在fa0/1的OSPF开销路由器的R4 :

R4(config)#int fa0/1
R4(config-if)#ip ospf cost 10

检查向前量度。它显示当前到达的开销ASBR R1是11 :

R4#show ip ospf border-routers
OSPF Router with ID (10.4.4.4) (Process ID 1)

Base Topology (MTID 0)
Internal Router Routing Table
Codes: i - Intra-area route, I - Inter-area route

i 10.3.3.3 [10] via 10.10.34.3, FastEthernet0/1, ABR, Area 0, SPF 7
I 10.1.1.1 [11] via 10.10.34.3, FastEthernet0/1, ASBR, Area 0, SPF 7
i 10.2.2.2 [1] via 10.10.24.2, FastEthernet0/0, ABR, Area 0, SPF 7
I 10.5.5.5 [2] via 10.10.24.2, FastEthernet0/0, ASBR, Area 0, SPF 7

这是在R4的路由表:

R4#show ip route 192.168.1.1 255.255.255.255
Routing entry for 192.168.1.1/32
Known via "ospf 1", distance 110, metric 10, type extern 2, forward metric 2
Last update from 10.10.24.2 on FastEthernet0/0, 00:02:17 ago
Routing Descriptor Blocks:
   10.10.24.2, from 10.5.5.5, 00:07:11 ago, via FastEthernet0/0
   Route metric is 10, traffic share count is 1

因此有更低向前量度的路由在路由表里安装。

总之,当您有类型5 LSA的时多个条目,第一个首选给对量度(重新分配的量度)。有低度量值的路由在路由表里安装。如果重新分配的量度是同样,第二个首选给对向前量度。有更低向前量度的路由在路由表里安装。

故障排除

目前没有针对此配置的故障排除信息。


相关的思科支持社区讨论

思科支持社区是您提问、解答问题、分享建议以及与工作伙伴协作的论坛。


Document ID: 118799