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

为什么有些 OSPF 路由在数据库里但不在路由表里?

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


交互:本文档对您的 Cisco 设备进行自定义分析。


目录


简介

常见问题,当曾经开放最短路径优先(OSPF)时是在数据库的路由没出现在路由表里。在大多数情况下OSPF查找在数据库的一个差异,因此在路由表里不安装路由。通常,您能看到ADV路由器是意味着的不可到达的消息(通告LSA的路由器不是可及的通过OSPF)在链路状态广播(LSA)顶部在数据库,当此问题发生时。示例如下:

Adv Router is not-reachable
LS age: 418
Options: (No TOS-capability, DC)
LS Type: Router Links
Link State ID: 172.16.32.2
Advertising Router: 172.16.32.2
LS Seq Number: 80000002
Checksum: 0xFA63
Length: 60
 Number of Links: 3

有此问题的几个原因,多数处理配置错误或一残破的拓扑。当更正配置OSPF数据库差异去离开,并且时路由在路由表里出现。本文解释能的数据库导致差异的某些更多常见原因。

某些命令在本文中用于OSPF行为的验证包括show ip ospf interfaceip OSPF数据库路由器show ip ospf neighborshow ip ospf database external。如果有的输出任何从您的Cisco设备的这些命令,您能使用 显示潜在问题和修正。要使用输出结果,您必须是注册用户,并且必须进行登录,还要激活JavaScript。

先决条件

要求

本文读者应该有这些主题知识

使用的组件

本文档中的信息基于以下软件和硬件版本:

  • Cisco IOS 软件版本12.3在所有路由器运行。

  • 所有Cisco路由器平台支持这。

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

规则

有关文档规则的详细信息,请参阅 Cisco 技术提示规则

原因1 :网络类型不匹配

请使用以下网络图为例:

/image/gif/paws/7112/26a.gif

R4-4K R1-7010
interface Loopback0
 ip address 172.16.33.1 255.255.255.255

interface Serial2
 ip address 172.16.32.1 255.255.255.0
 ip ospf network broadcast

router ospf 20
 network 172.16.0.0 0.0.255.255 area 0
interface Loopback0
 ip address 172.16.30.1 255.255.255.255
!
interface Serial1/0
 ip address 172.16.32.2 255.255.255.0
 clockrate 64000

router ospf 20
 network 172.16.0.0 0.0.255.255 area 0

R4-4K(4)# show ip ospf interface serial 2
Serial2 is up, line protocol is up 
  Internet Address 172.16.32.1/24, Area 0 
  Process ID 20, Router ID 172.16.33.1, Network Type BROADCAST, Cost: 64
  Transmit Delay is 1 sec, State DR, Priority 1 
  Designated Router (ID) 172.16.33.1, Interface address 172.16.32.1
  Backup Designated router (ID) 172.16.32.2, Interface address 172.16.32.2
  Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
    Hello due in 00:00:08
  Neighbor Count is 1, Adjacent neighbor count is 1 
    Adjacent with neighbor 172.16.32.2  (Backup Designated Router)
  Suppress hello for 0 neighbor(s)

R1-7010(5)# show ip ospf interface serial 1/0
Serial1/0 is up, line protocol is up 
  Internet Address 172.16.32.2/24, Area 0 
  Process ID 20, Router ID 172.16.32.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
    Hello due in 00:00:02
  Neighbor Count is 1, Adjacent neighbor count is 1 
    Adjacent with neighbor 172.16.33.1
  Suppress hello for 0 neighbor(s)

正如您上面看到的路由器R4-4K为广播配置,并且路由器R1-7010为点对点配置。这种网络类型不匹配做通告路由器不可达的。

R4-4K(4)# show ip ospf database router 172.16.32.2

  Adv Router is not-reachable
  LS age: 418
  Options: (No TOS-capability, DC)
  LS Type: Router Links
  Link State ID: 172.16.32.2
  Advertising Router: 172.16.32.2
  LS Seq Number: 80000002
  Checksum: 0xFA63
  Length: 60
   Number of Links: 3

    Link connected to: another Router (point-to-point)
    (Link ID) Neighboring Router ID: 172.16.33.1
    (Link Data) Router Interface address: 172.16.32.2
    Number of TOS metrics: 0
    TOS 0 Metrics: 64

    Link connected to: a Stub Network
    (Link ID) Network/subnet number: 172.16.32.0
    (Link Data) Network Mask: 255.255.255.0
    Number of TOS metrics: 0
    TOS 0 Metrics: 64

R1-7010(5)# show ip ospf database router 172.16.33.1

  Adv Router is not-reachable
  LS age: 357
  Options: (No TOS-capability, DC)
  LS Type: Router Links
  Link State ID: 172.16.33.1
  Advertising Router: 172.16.33.1
  LS Seq Number: 8000000A
  Checksum: 0xD4AA
  Length: 48
   Number of Links: 2

     Link connected to: a Transit Network
     (Link ID) Designated Router address: 172.16.32.1
     (Link Data) Router Interface address: 172.16.32.1
     Number of TOS metrics: 0
     TOS 0 Metrics: 64

您能为子网172.16.32.0/24看到那,路由器R1-7010生成点对点链路,并且路由器R4-4K生成转接链路。这创建在链路状态数据库的一个差异,含义路由在路由表里没有安装。

R1-7010(5)# show ip route
172.16.0.0/16 is variably subnetted, 3 subnets, 2 masks
C       172.16.32.0/24 is directly connected, Serial1/0
C       172.16.30.1/32 is directly connected, Loopback0

解决方案

要解决此问题,请配置同一种网络类型的两路由器。您能更改路由器R1-7010网络类型广播或者更改路由器R4-4K's serial interfaces到点对点。

注意: 如果有然后一端是多点接口和的一个情况其他侧是sub-interface更改网络类型广播在两边。

在本例中,因为两边是点到点高级数据链路控制(HDLC)封装的接口,我们删除在R4-4K的“网络类型广播”语句。

R4-4K(4)# configure terminal 
R4-4K(4)(config)# interface serial 2 
R4-4K(4)(config-if)# no ip ospf network broadcast 
R4-4K(4)(config-if)# end

R4-4K(4)# show ip ospf interface serial 2
 Serial2 is up, line protocol is up 
  Internet Address 172.16.32.1/24, Area 0 
  Process ID 20, Router ID 172.16.33.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
   Hello due in 00:00:04
  Neighbor Count is 1, Adjacent neighbor count is 1 
  Adjacent with neighbor 172.16.32.2
  Suppress hello for 0 neighbor(s)

原因2 :在DUAL串行链路设置的错误地址分配

考虑此网络图为例:

/image/gif/paws/7112/26b.gif

R4-4K R1-7010
interface loopback 0
 ip address 172.16.35.1 255.255.255.255

interface Serial2
 ip address 172.16.29.1 255.255.255.0
!
interface Serial3
 ip address 172.16.32.1 255.255.255.0

router ospf 20
 network 172.16.0.0 0.0.255.255 area 0
interface loopback 0
 ip address 172.16.30.1 255.255.255.255

interface Serial1/0
 ip address 172.16.32.2 255.255.255.0
 clockrate 64000
!
interface Serial1/1
 ip address 172.16.29.2 255.255.255.0
 clockrate 38400

router ospf 20
 network 172.16.0.0 0.0.255.255 area 0

您能看到IP地址在上述配置里被翻转的OSPF数据库导致一个差异。然而,路由器仍然形成的Cisco IOS版本的邻居早于12.1,因为在点对点链路, OSPF路由器不验证相邻路由器是在相同子网。

R4-4K(4)# show ip ospf neighbor

Neighbor ID     Pri   State           Dead Time   Address         Interface
172.16.32.2       1   FULL/  -        00:00:37    172.16.32.2     Serial2
172.16.32.2       1   FULL/  -        00:00:31    172.16.29.2     Serial3

从上述输出,您能看到Serial2形成有IP地址172.16.32.2的邻居,不是在相同子网。虽然邻居形成,路由在路由表里没有安装:

R1-7010(5)# show ip route
172.16.0.0/16 is variably subnetted, 3 subnets, 2 masks
C       172.16.32.0/24 is directly connected, Serial1/0
C       172.16.29.0/24 is directly connected, Serial1/1
C       172.16.30.1/32 is directly connected, Loopback0

解决方案

要解决此问题,正确地分配IP地址或交换串行电缆。此处我们更正了IP地址:

R4-4K R1-7010
interface loopback 0
 ip address 172.16.35.1 255.255.255.255

interface Serial2
 ip address 172.16.32.1 255.255.255.0
!
interface Serial3
 ip address 172.16.29.1 255.255.255.0

router ospf 20
 network 172.16.0.0 0.0.255.255 area 0
interface loopback 0
 ip address 172.16.30.1 255.255.255.255

interface Serial1/0
 ip address 172.16.32.2 255.255.255.0
 clockrate 64000
!
interface Serial1/1
 ip address 172.16.29.2 255.255.255.0
 clockrate 38400

router ospf 20
 network 172.16.0.0 0.0.255.255 area 0

R4-4K(4)# show ip ospf neighbor

Neighbor ID     Pri   State           Dead Time   Address         Interface
172.16.32.2       1   FULL/  -        00:00:36    172.16.32.2     Serial2
172.16.32.2       1   FULL/  -        00:00:39    172.16.29.2     Serial3

现在它显示在Serial2接口的正确邻居地址。路由也在路由表里:

R1-7010(5)# show ip route
172.16.0.0/16 is variably subnetted, 4 subnets, 2 masks
C       172.16.32.0/24 is directly connected, Serial1/0
O       172.16.35.1/32 [110/65] via 172.16.32.1, 00:03:12, Serial1/0
                       [110/65] via 172.16.29.1, 00:03:12, Serial1/1
C       172.16.29.0/24 is directly connected, Serial1/1
C       172.16.30.1/32 is directly connected, Loopback0

原因3 :在错误的Majornet或子网包括的点对点链路的一端

考虑此网络图为例:

/image/gif/paws/7112/26c.gif

此情况创建同一种行为象在DUAL串行链路设置的错误地址分配。要解决问题,请分配在相同子网的IP地址在两路由器。

原因4 :一端未编号的,并且另一旁拉被编号

考虑以下网络图为例:

/image/gif/paws/7112/unnum.gif

R4-4K R1-7010
interface Loopback0
 ip address 172.16.35.1 255.255.255.255

interface Serial2
 ip unnumbered Loopback0
 router ospf 20
 network 172.16.0.0 0.0.255.255 area 0
interface Loopback0
 ip address 172.16.30.1 255.255.255.255
!
interface Serial1/0
 ip address 172.16.32.2 255.255.255.0
 clockrate 64000

router ospf 20
 network 172.16.0.0 0.0.255.255 area 0

R4-4K(4)# show interface serial 2
Serial2 is up, line protocol is up 
  Hardware is cxBus Serial
  Interface is unnumbered.  Using address of Loopback0 (172.16.35.1)

R1-7010(5)# show interface serial 1/0
Serial1/0 is up, line protocol is up 
  Hardware is cxBus Serial
  Internet address is 172.16.32.2/24

以上输出显示R4-4K's Serial2接口是未编号的对Loopback0,而R1-7010's Serial1/0是编号的接口。

R4-4K(4)# show ip ospf interface serial 2
Serial2 is up, line protocol is up 
  Internet Address 0.0.0.0/24, Area 0 
  Process ID 20, Router ID 172.16.35.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
    Hello due in 00:00:02
  Neighbor Count is 1, Adjacent neighbor count is 1 
    Adjacent with neighbor 172.16.32.2
  Suppress hello for 0 neighbor(s)

R1-7010(5)# show ip ospf interface serial 1/0
Serial1/0 is up, line protocol is up 
  Internet Address 172.16.32.2/24, Area 0 
  Process ID 20, Router ID 172.16.32.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
    Hello due in 00:00:02
  Neighbor Count is 1, Adjacent neighbor count is 1 
    Adjacent with neighbor 172.16.33.1
  Suppress hello for 0 neighbor(s)

正如您上面看到的网络类型在两种情况下点到点。问题是一端未编号的,并且另一侧不是,创建在数据库的一个差异如下所示。

R4-4K(4)# show ip ospf database router 172.16.30.1

  OSPF Router with ID (172.16.35.1) (Process ID 20)
 Router Link States (Area 0)
 LS age: 202
     Options: (No TOS-capability, DC)
     LS Type: Router Links
     Link State ID: 172.16.30.1
     Advertising Router: 172.16.30.1
     LS Seq Number: 80000002
     Checksum: 0xC899
     Length: 60
     Number of Links: 3
 Link connected to: another Router (point-to-point)
     (Link ID) Neighboring Router ID: 172.16.35.1
     (Link Data) Router Interface address: 172.16.32.2
     Number of TOS metrics: 0
     TOS 0 Metrics: 64
 Link connected to: a Stub Network
     (Link ID) Network/subnet number: 172.16.32.0
     (Link Data) Network Mask: 255.255.255.0
     Number of TOS metrics: 0
     TOS 0 Metrics: 64
 Link connected to: a Stub Network
     (Link ID) Network/subnet number: 172.16.30.1
     (Link Data) Network Mask: 255.255.255.255
     Number of TOS metrics: 0
     TOS 0 Metrics: 1

     R4-4k(4)#
    
R1-7010(5)# show ip ospf database router 172.16.35.1

OSPF Router with ID (172.16.30.1) (Process ID 20)
     Router Link States (Area 0)
 Adv Router is not-reachable
     LS age: 396
     Options: (No TOS-capability, DC)
     LS Type: Router Links
     Link State ID: 172.16.35.1
     Advertising Router: 172.16.35.1
     LS Seq Number: 80000003
     Checksum: 0xBEA1
     Length: 48
     Number of Links: 2
 Link connected to: another Router (point-to-point)
     (Link ID) Neighboring Router ID: 172.16.30.1
     (Link Data) Router Interface address: 0.0.0.3

          
!--- In case of an unnumbered link we use MIB 
          !--- II IfIndex value which usually starts with 0.

          
     Number of TOS metrics: 0
     TOS 0 Metrics: 64
 Link connected to: a Stub Network
     (Link ID) Network/subnet number: 172.16.35.1
     (Link Data) Network Mask: 255.255.255.255
     Number of TOS metrics: 0
     TOS 0 Metrics: 1

     R1-7010(5)#

您能看到R1-7010生成此点对点链路的LSA与包含其接口地址的Link Data字段,而R4-4K生成同一条链路的LSA与包含MIBII IfIndex值的Link Data字段。这创建在链路状态数据库的一个差异,含义路由在路由表里没有安装。

R1-7010(5)# show ip route
172.16.0.0/16 is variably subnetted, 3 subnets, 2 masks
C       172.16.32.0/24 is directly connected, Serial1/0
C       172.16.30.1/32 is directly connected, Loopback0

解决方案

要解决此问题,请配置路由器的serial interfaces如或者编号或未编号的。在本例中我们编号了路由器R4-4K序列2接口。

R4-4K(4)# configure terminal 
R4-4K(4)(config)# interface serial 2
R4-4K(4)(config-if)# no ip unnumbered loopback 0 
R4-4K(4)(config-if)# ip address 172.16.32.1 255.255.255.0

R4-4K(4))# show ip ospf interface serial 2
Serial2 is up, line protocol is up 
  Internet Address 172.16.32.1/24, Area 0 
  Process ID 20, Router ID 172.16.33.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
    Hello due in 00:00:02
  Neighbor Count is 1, Adjacent neighbor count is 1 
    Adjacent with neighbor 172.16.32.2
  Suppress hello for 0 neighbor(s)

R1-7010(5)# show ip route
172.16.0.0/16 is variably subnetted, 3 subnets, 2 masks
C       172.16.32.0/24 is directly connected, Serial1/0
O       172.16.33.1/32 [110/65] via 172.16.32.1, 00:03:08, Serial1/0
C       172.16.30.1/32 is directly connected, Loopback0

原因5 :在全网状帧中继环境的中断的PVC

考虑此网络图为例:

/image/gif/paws/7112/26d.gif

R9-2500
interface Loopback0
 ip address 50.50.50.50 255.255.255.255
 !
interface Serial0
 ip address 10.10.10.5 255.255.255.0
 encapsulation frame-relay
 ip ospf network broadcast 
 frame-relay map ip 10.10.10.6 102 broadcast
 frame-relay map ip 10.10.10.7 101 broadcast

router ospf 10
 network 10.10.10.0 0.0.0.255 area 0
 network 50.50.50.0 0.0.0.255 area 0

R4-4K
interface Loopback0
 ip address 70.70.70.70 255.255.255.255
!
interface Serial0
 ip address 10.10.10.7 255.255.255.0
 encapsulation frame-relay
 ip ospf network broadcast
 frame-relay map ip 10.10.10.5 101 broadcast
 frame-relay map ip 10.10.10.6 100 broadcast

router ospf 10
 network 10.10.10.0 0.0.0.255 area 0
 network 70.70.70.0 0.0.0.255 area 0

R3-4K
interface Loopback0
 ip address 60.60.60.60 255.255.255.255
 !
interface Serial0
 no ip address
 encapsulation frame-relay
!
interface Serial0.1 multipoint
 ip address 10.10.10.6 255.255.255.0
 ip ospf network broadcast
 frame-relay map ip 10.10.10.5 102 broadcast
 frame-relay map ip 10.10.10.7 100 broadcast
!
router ospf 10
 network 10.10.10.0 0.0.0.255 area 0
 network 60.60.60.0 0.0.0.255 area 0

只要帧中继网云充分地网状连接,在帧中继的广播模型正常运转。如果任何永久虚电路(PVC)是残破的,它能制造在OSPF数据库的问题,反过来生成ADV路由器不可及的消息。

在本例中,在R9-2500之间的PVC和R4-4K是残破的,并且对指定路由器(DR)的R9-2500链路是残破的。结果, R9-2500宣称从(的所有LSA不是DR)的R3-4K,作为不可达的。正如你看到的R9-2500不生成serial interfaces的转接链路附加对R3-4K;它生成残余部分链路,因为,就R9-2500而言没有在此链路的DR。

R9-2500(3)# show ip ospf database router

       OSPF Router with ID (50.50.50.50) (Process ID 10)
                Router Link States (Area 0)
  LS age: 148
  Options: (No TOS-capability, DC)
  LS Type: Router Links
  Link State ID: 50.50.50.50
  Advertising Router: 50.50.50.50
  LS Seq Number: 8000000B
  Checksum: 0x55A
  Length: 48
   Number of Links: 2

    Link connected to: a Stub Network
    (Link ID) Network/subnet number: 10.10.10.0
    (Link Data) Network Mask: 255.255.255.0
    Number of TOS metrics: 0
    TOS 0 Metrics: 64

    Link connected to: a Stub Network
    (Link ID) Network/subnet number: 50.50.50.50
    (Link Data) Network Mask: 255.255.255.255
    Number of TOS metrics: 0
    TOS 0 Metrics: 1

  Adv Router is not-reachable
  LS age: 1081
  Options: (No TOS-capability, DC)
  LS Type: Router Links
  Link State ID: 60.60.60.60
  Advertising Router: 60.60.60.60
  LS Seq Number: 80000006
  Checksum: 0x4F72
  Length: 48
   Number of Links: 2

    Link connected to: a Stub Network
    (Link ID) Network/subnet number: 60.60.60.60
    (Link Data) Network Mask: 255.255.255.255
    Number of TOS metrics: 0
    TOS 0 Metrics: 1

    Link connected to: a Transit Network
    (Link ID) Designated Router address: 10.10.10.7
    (Link Data) Router Interface address: 10.10.10.6
    Number of TOS metrics: 0
    TOS 0 Metrics: 64

          
  Adv Router is not-reachable
  LS age: 306
  Options: (No TOS-capability, DC)
  LS Type: Router Links
  Link State ID: 70.70.70.70
  Advertising Router: 70.70.70.70
  LS Seq Number: 80000007
  Checksum: 0xC185
  Length: 48
   Number of Links: 2

    Link connected to: a Stub Network
    (Link ID) Network/subnet number: 70.70.70.70
    (Link Data) Network Mask: 255.255.255.255
    Number of TOS metrics: 0
    TOS 0 Metrics: 1

    Link connected to: a Transit Network
    (Link ID) Designated Router address: 10.10.10.7
    (Link Data) Router Interface address: 10.10.10.7
    Number of TOS metrics: 0
    TOS 0 Metrics: 64

参考关于运行OSPF的问题在帧中继的NBMA模式关于此问题的更详细信息。

原因6 :通过外部路由已知的转发地址

考虑此网络图为例:

/image/gif/paws/7112/foradd.gif

R2507
interface Serial0
ip address 1.1.1.1 255.255.255.0
         
interface Serial1
ip address 7.7.7.1 255.255.255.0
         
router ospf 1
network 1.1.1.1 0.0.0.0 area 0
default- information originate metric 20
         
ip route 0.0.0.0 0.0.0.0 Serial1

R2504
interface Serial0
ip address 1.1.1.2 255.255.255.0
         
interface TokenRing0
ip address 3.3.4.2 255.255.255.0
         
router ospf 1
network 1.1.1.0 0.0.0.255 area 0
network 3.0.0.0 0.255.255.255 area 1
area 1 range 3.0.0.0 255.0.0.0

R2515
interface Serial1
ip address 4.4.4.3 255.255.255.0
       
interface TokenRing0
ip address 3.3.4.3 255.255.255.0
       
interface ethernet 0
ip address 3.44.66.3 255.255.255.0
       
interface ethernet 1
ip address 3.22.88.3 255.255.255.0
       
router ospf 1
redistribute rip metric 20 subnets
network 0.0.0.0 255.255.255.255 area 1
       
router rip
network 3.0.0.0

R2513
interface TokenRing0
ip address 3.3.4.4 255.255.255.0
       
interface ethernet 0
ip address 200.1.1.4 255.255.255.0
       
router rip
network 3.0.0.0
network 200.1.1.0

R2507# show ip ospf data external 200.1.1.0
       OSPF Router with ID (7.7.7.1) (Process ID 1)
       Type- 5 AS External Link States
       LS age: 72
       Options: (No TOS- capability, DC)
       LS Type: AS External Link
       Link State ID: 200.1.1.0 (External Network Number )
       Advertising Router: 3.44.66.3
       LS Seq Number: 80000001
       Checksum: 0xF161
       Length: 36
       Network Mask: /24
                   Metric Type: 2 (Larger than any link state path)
                   TOS: 0
                   Metric: 20
                   Forward Address: 3.3.4.4
                   External Route Tag: 0

R2507有200.1.1.0/24在其数据库,但是在路由表里未安装它,因为3.3.4.4通过OSPF外部路由了解。

R2507# show ip route 3.3.4.4
       Routing entry for 3.3.4.0/ 24
       Known via "ospf 1", distance 110, metric 20,type extern 2, forward metric 70
       Redistributing via ospf 1
       Last update from 1.1.1.2 on Serial0, 00: 00: 40 ago
       Routing Descriptor Blocks:
       * 1.1.1.2, from 3.44.66.3, 00: 00: 40 ago, via Serial0
          Route metric is 20, traffic share count is 1

注意: 采用Cisco bug ID CSCdp72526 (仅限于注册用户)进行修复时,OSPF不会生成重叠外部网络的第5类链路状态广播(LSA)。因此, R2507只将有概略的区域内路由3.0.0.0/8。然后,R2507将安装200.1.1.0/24作为转发地址,它将可通过区域内路由3.0.0.0/8到达,从而与RFC 2328保持一致。leavingcisco.com

在上述的bug修正,输出将看起来象以下后:

R2507# show ip route 3.3.4.4
      Routing entry for 3.0.0.0/8
      Known via "ospf 1", distance 110, metric 74, type inter area
      Last update from 1.1.1.2 on Serial0, 00:19:20 ago
      Routing Descriptor Blocks:
      * 1.1.1.2, from 3.3.4.2, 00:19:20 ago, via Serial0



R2507# show ip route  
      Codes: 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 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 route

Gateway of last resort is not set

1.0.0.0/24 is subnetted, 1 subnets
    C 1.1.1.0 is directly connected, Serial0
    O IA 3.0.0.0/8 [110/74] via 1.1.1.2, 00:30:18, Serial0
    O E2 200.1.1.0/24 [110/20] via 1.1.1.2, 00:22:58, Serial0
    Route metric is 74, traffic share count is 1

R2507#

如果转发地址通过外部路由也知道, OSPF在路由表里不安装该路由。关于此问题的更详细信息,请参阅与OSPF转发地址有关的常见路由问题

原因7 :分配列表阻塞路由

请使用以下网络图为例:

/image/gif/paws/7112/26a.gif

R4-4K R1-7010
interface Loopback0
 ip address 172.16.33.1 255.255.255.255

interface Serial2
 ip address 172.16.32.1 255.255.255.0

router ospf 20
 network 172.16.0.0 0.0.255.255 area 0
interface Loopback0
 ip address 172.16.30.1 255.255.255.255
!
interface Serial1/0
 ip address 172.16.32.2 255.255.255.0
 clockrate 64000

router ospf 20
 network 172.16.0.0 0.0.255.255 area 0
 distribute-list 1 in
!
access-list 1 permit 172.16.32.0. 0.0.0.255

正如您上面看到的R1-7010有distribute-list命令已配置的,并且只提供172.16.32.0/24在路由表里将安装的地址范围。在链路状态协议您不能确实过滤LSA用distribute-list命令。LSA在数据库;然而LSA在路由表里不会安装。

R1-7010(5)# show ip ospf database router 172.16.33.1

  LS age: 357
  Options: (No TOS-capability, DC)
  LS Type: Router Links
  Link State ID: 172.16.33.1
  Advertising Router: 172.16.33.1
  LS Seq Number: 8000000A
  Checksum: 0xD4AA
  Length: 48
   Number of Links: 3

 Link connected to: another Router (point-to-point)
    (Link ID) Neighboring Router ID: 172.16.32.2
    (Link Data) Router Interface address: 172.16.32.1
    Number of TOS metrics: 0
    TOS 0 Metrics: 64

distribute-list configuration命令在R1-7010在路由表里过滤从安装的172.16.33.1/32网络。

R1-7010(5)# show ip route
172.16.0.0/16 is variably subnetted, 3 subnets, 2 masks
C       172.16.32.0/24 is directly connected, Serial1/0
C       172.16.30.1/32 is directly connected, Loopback0

解决方案

要解决此问题,配置R1-7010和允许172.16.33.0/24在访问控制表(ACL),因此此网络在路由表里被安装。

R1-7010(5)# configure terminal 
R1-7010(5)(config)# access-list 1 permit 172.16.33.0 0.0.0.255 
R1-7010(5)(config)# end

R1-7010(5)# show ip access-list 1
Standard IP access list 1
    permit 172.16.32.0, wildcard bits 0.0.0.255
    permit 172.16.33.0, wildcard bits 0.0.0.255

R1-7010(5)# show ip route
172.16.0.0/16 is variably subnetted, 3 subnets, 2 masks
C       172.16.32.0/24 is directly connected, Serial1/0
O       172.16.33.1/32 [110/65] via 172.16.32.1, 00:00:08, Serial1/0
C       172.16.30.1/32 is directly connected, Loopback0

相关的思科支持社区讨论

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


相关信息


Document ID: 7112