快速,持续,稳定,傻瓜式
支持Mysql,Sqlserver数据同步

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

请联系QQ:1793040 索取软件

展开全文

作者: Syed Faraz Shamim










常见的问题,当使用开放式最短路径优先(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 interface、ip OSPF数据库路由器、show ip ospf neighborshow ip ospf database external。 如果有的输出任何这些命令从您的Cisco设备,您能使用
显示潜在问题和修正。 要使用输出结果,您必须是注册用户,并且必须进行登录,还要激活JavaScript。

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

  • OSPF基本的了解

  • OSPF的基本配置

本文件中的信息以下列软件和硬件版本为依据。

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

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

本文档中的信息都是在特定的实验室环境中的设备中创建的。 本文所引用的所有设备均采用原始 (缺省)配置。 如果您的网络处于活动状态,确保您了解所有命令的潜在影响。

有关文件规则的更详尽信息请参阅Cisco技术提示规则。

请例如使用以下网络图:

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串行接口到点到点。

注意:?如果有一个情况然后,其中一端是多点接口和其他边是子接口更改网络类型播放在两边。

在本例中,因为两边是点到点高级数据链路控制(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)

例如考虑此网络图:

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

现在它在序列2接口显示正确的相邻地址。 路由也在路由表里:

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

例如考虑此网络图:

26c.gif

此情况创建完全相同的工作情况作为。 要解决问题,请分配IP地址在相同子网在两个路由器。

例如考虑以下网络图:

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序列2接口是未编号的对Loopback0,而R1-7010序列1/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

要解决此问题,请配置路由器串行接口如或者编号或未编号的。 在本例中我们编号了路由器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

例如考虑此网络图:

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路由器不可及的消息。

在本例中, PVC在R9-2500之间和R4-4K是残破的,并且R9-2500指定路由器(DR)的链路是残破的。 结果, R9-2500宣称所有LSA从不是DR)的R3-4K (如不可得到的。 正如你看到的R9-2500不形成转接链路为串行接口属于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模式下更多详细信息关于此问题。

例如考虑此网络图:

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

注意:?采用思科臭虫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转发地址有关的常见路由问题。

请例如使用以下网络图:

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

网络专业人士连接是网络专业人士的一个论坛,它共享网络解决方案、产品和技术的相关问题、建议和信息。 功能链路是此技术可用的一些最近的会话。

Net Pro论坛-专题对话为RP
服务提供商:MPLS
虚拟专用网络:服务
虚拟专用网络:安全


  • OSPF支持页面
  • OSPF :常见问题
  • 技术支持思科系统

相关推荐

咨询软件
 
QQ在线咨询
售前咨询热线
QQ1793040