注册 登录  
 加关注
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

欢迎光临shaying110的博客

RSed-ISPing

 
 
 

日志

 
 

OSPF转发地址的作用  

2011-04-15 17:30:50|  分类: CISCO网络 |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |

OSPF路由中转发地址必须在路由表中可达,这个路由才呈现在OSPF路由表中,否则OSPF DB中有这个LSA,而路由表中则没有这条路由。这个经常在OSPF的NSSA区域中出现。这时使用ar 1 nssa translate type7 suppress-fa将转发地址转换为0.0.0.0就行了

如下图所示配置:

R1---R2---R3

R1、R2是OSPF区域1中,该区域为NSSA区域,表R1上有静态路由172.16.0.0/16下一跳是NULL0,并将些路由重分发到OSPF中,R2、R3在OSPF区域0中。

基本配置:

R1:

router ospf 123
 router-id 10.10.1.1
 log-adjacency-changes
 area 1 nssa
 redistribute static subnets
 network 10.10.1.1 0.0.0.0 area 1
 network 10.12.12.1 0.0.0.0 area 1

 

ip route 172.16.0.0 255.255.0.0 Null0

R2:

router ospf 123
 log-adjacency-changes
 area 1 nssa
 network 10.10.2.2 0.0.0.0 area 0
 network 10.10.12.2 0.0.0.0 area 1
 network 10.10.23.2 0.0.0.0 area 0
 network 10.12.12.2 0.0.0.0 area 1

R3:

router ospf 123
 log-adjacency-changes
 network 0.0.0.0 255.255.255.255 area 0
r3#

 

验证:

在R3上查看路由表和LSA5及转发地址的路由

r3#sh ip route os
O E2 172.16.0.0/16 [110/20] via 10.10.23.2, 00:06:08, Serial1/1
     10.0.0.0/8 is variably subnetted, 5 subnets, 2 masks
O       10.10.2.2/32 [110/65] via 10.10.23.2, 00:08:16, Serial1/1
O IA    10.10.1.1/32 [110/129] via 10.10.23.2, 00:06:13, Serial1/1
O IA    10.12.12.0/24 [110/128] via 10.10.23.2, 00:08:16, Serial1/1
r3#sh ip os da ex
r3#sh ip os da external

            OSPF Router with ID (10.10.3.3) (Process ID 123)

                Type-5 AS External Link States

  Routing Bit Set on this LSA
  LS age: 404
  Options: (No TOS-capability, DC)
  LS Type: AS External Link
  Link State ID: 172.16.0.0 (External Network Number )
  Advertising Router: 10.10.2.2
  LS Seq Number: 80000003
  Checksum: 0x9B18
  Length: 36
  Network Mask: /16
        Metric Type: 2 (Larger than any link state path)
        TOS: 0
        Metric: 20
        Forward Address: 10.10.1.1
        External Route Tag: 0

r3#sh ip route 10.10.1.1
Routing entry for 10.10.1.1/32
  Known via "ospf 123", distance 110, metric 129, type inter area
  Last update from 10.10.23.2 on Serial1/1, 00:06:22 ago
  Routing Descriptor Blocks:
  * 10.10.23.2, from 10.10.2.2, 00:06:22 ago, via Serial1/1
      Route metric is 129, traffic share count is 1

r3#

 

现在在R2上抑制掉10.10.1.1的路由

router os 123

ar 1 rang 10.10.1.1 255.255.255.255 not-advertise

然后 在R3上重复上述操作

r3#sh ip route os
     10.0.0.0/8 is variably subnetted, 4 subnets, 2 masks
O       10.10.2.2/32 [110/65] via 10.10.23.2, 00:09:56, Serial1/1
O IA    10.12.12.0/24 [110/128] via 10.10.23.2, 00:09:56, Serial1/1
r3#sh ip os da ex
r3#sh ip os da external

            OSPF Router with ID (10.10.3.3) (Process ID 123)

                Type-5 AS External Link States

  LS age: 506
  Options: (No TOS-capability, DC)
  LS Type: AS External Link
  Link State ID: 172.16.0.0 (External Network Number )
  Advertising Router: 10.10.2.2
  LS Seq Number: 80000003
  Checksum: 0x9B18
  Length: 36
  Network Mask: /16
        Metric Type: 2 (Larger than any link state path)
        TOS: 0
        Metric: 20
        Forward Address: 10.10.1.1
        External Route Tag: 0

r3#sh ip route 10.10.1.1
% Subnet not in table
r3#

此时172.16.0.0/16并没有出现在路由表中,而在DB中则有LSA5,但转发地址10.10.1.1并不在路由表中,所以这个路由也不在路由表中,下面,在R2上稍作调整,

area 1 nssa translate type7 suppress-fa

 

r3#sh ip route os      
O E2 172.16.0.0/16 [110/20] via 10.10.23.2, 00:00:06, Serial1/1
     10.0.0.0/8 is variably subnetted, 4 subnets, 2 masks
O       10.10.2.2/32 [110/65] via 10.10.23.2, 00:12:05, Serial1/1
O IA    10.12.12.0/24 [110/128] via 10.10.23.2, 00:12:05, Serial1/1
r3#sh ip os da external

            OSPF Router with ID (10.10.3.3) (Process ID 123)

                Type-5 AS External Link States

  Routing Bit Set on this LSA
  LS age: 10
  Options: (No TOS-capability, DC)
  LS Type: AS External Link
  Link State ID: 172.16.0.0 (External Network Number )
  Advertising Router: 10.10.2.2
  LS Seq Number: 80000004
  Checksum: 0x9731
  Length: 36
  Network Mask: /16
        Metric Type: 2 (Larger than any link state path)
        TOS: 0
        Metric: 20
        Forward Address: 0.0.0.0
        External Route Tag: 0
R3上此时有了这条路由,并且转发地址为0.0.0.0

  评论这张
 
阅读(1281)| 评论(0)
推荐 转载

历史上的今天

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2017