玩转华为ENSP模拟器系列 | 配置OSPF的Stub区域示例

素材来源:华为路由器配置指南

一边学习一边整理试验笔记,并与大家分享,侵权即删,谢谢支持!

附上汇总贴:玩转华为ENSP模拟器系列 | 合集_COCOgsta的博客-CSDN博客_ensp实验大全


目标

介绍了将引入了静态路由的普通区域配置成Stub区域的过程,可以在不影响路由可达性的前提下减少通告到此区域内的LSA数量。

组网需求

如图1所示,所有的路由器都运行OSPF,整个自治系统划分为3个区域。其中DeviceA和DeviceB作为ABR来发布区域之间的路由,DeviceD作为ASBR引入了外部路由(静态路由)。

要求将Area1配置为Stub区域,减少通告到此区域内的LSA数量,但不影响路由的可达性。

配置思路

  • 在各路由器上配置OSPF基本功能,实现互连。
  • 在DeviceD上配置静态路由,并在OSPF中引入。
  • 配置Area1为Stub区域(需要在Area1内所有的路由器上配置stub命令),在DeviceC上查看OSPF路由信息。
  • 在DeviceA上配置禁止向Stub区域通告Type3 LSA,在DeviceC上查看OSPF路由信息。

操作步骤

  1. 配置接口的IP地址(略)
  2. 配置OSPF基本功能
  3. 配置DeviceD引入静态路由
DeviceD:
ip route-static 10.0.0.0 255.0.0.0 NULL0
ospf 1
 import-route static type 1

查看DeviceC的ABR和ASBR信息。

[~DeviceC]display ospf abr-asbr
          OSPF Process 1 with Router ID 3.3.3.3
                  Routing Table to ABR and ASBR
 Type        Destination     Area            Cost       Nexthop         RtType  
 INTRA-AREA  1.1.1.1         0.0.0.1         1          192.168.1.1     ABR     
 INTER-AREA  4.4.4.4         0.0.0.1         3          192.168.1.1     ASBR    
[~DeviceC]

查看DeviceC的OSPF路由表。

[~DeviceC] display ospf routing 
          OSPF Process 1 with Router ID 3.3.3.3
                   Routing Tables
 Routing for Network
 Destination        Cost     Type       NextHop         AdvRouter       Area           
 172.16.1.0/24      1        Direct     172.16.1.1      3.3.3.3         0.0.0.1        
 172.17.1.0/24      4        Inter-area 192.168.1.1     1.1.1.1         0.0.0.1        
 192.168.0.0/24     2        Inter-area 192.168.1.1     1.1.1.1         0.0.0.1        
 192.168.1.0/24     1        Direct     192.168.1.2     3.3.3.3         0.0.0.1        
 192.168.2.0/24     3        Inter-area 192.168.1.1     1.1.1.1         0.0.0.1        
 Routing for ASEs
 Destination        Cost       Type       Tag        NextHop         AdvRouter      
 10.0.0.0/8         4          Type1      1          192.168.1.1     4.4.4.4        
 Total Nets: 6
 Intra Area: 2  Inter Area: 3  ASE: 1  NSSA: 0
          OSPF Process 65534 with Router ID 128.1.138.137
                   Routing Tables
 Routing for Network
 Destination        Cost     Type       NextHop         AdvRouter       Area           
 128.1.138.137/32   0        Direct     128.1.138.137   128.1.138.137   0.0.0.0        
 128.1.138.138/32   100      Stub       128.1.138.138   128.1.138.138   0.0.0.0        
 128.1.138.138/32   100      Stub       128.1.138.138   128.1.138.138   0.0.0.0        
 128.1.138.139/32   100      Stub       128.1.138.139   128.1.138.139   0.0.0.0        
 128.1.138.139/32   100      Stub       128.1.138.139   128.1.138.139   0.0.0.0        
 128.1.138.140/32   200      Stub       128.1.138.138   128.1.138.140   0.0.0.0        
 128.1.138.140/32   200      Stub       128.1.138.138   128.1.138.140   0.0.0.0        
 128.1.138.141/32   300      Stub       128.1.138.138   128.1.138.141   0.0.0.0        
 128.1.138.141/32   300      Stub       128.1.138.138   128.1.138.141   0.0.0.0        
 128.1.138.142/32   400      Stub       128.1.138.138   128.1.138.142   0.0.0.0        
 128.1.138.142/32   400      Stub       128.1.138.138   128.1.138.142   0.0.0.0        
 Total Nets: 6
 Intra Area: 6  Inter Area: 0  ASE: 0  NSSA: 0
[~DeviceC] 

说明:当DeviceC所在区域为普通区域时,可以看到路由表中存在AS外部的路由。

  1. 配置Area1为Stub区域

配置DeviceA。

DeviceA:
ospf 1
 area 0.0.0.1
  stub

配置DeviceC。

DeviceC:
ospf 1
 area 0.0.0.1
  stub

配置DeviceE。

DeviceE:
ospf 1
 area 0.0.0.1
  stub

显示DeviceC的路由表。

[~DeviceC]display ospf routing 
          OSPF Process 1 with Router ID 3.3.3.3
                   Routing Tables
 Routing for Network
 Destination        Cost     Type       NextHop         AdvRouter       Area           
 0.0.0.0/0          2        Inter-area 192.168.1.1     1.1.1.1         0.0.0.1        
 172.16.1.0/24      1        Direct     172.16.1.1      3.3.3.3         0.0.0.1        
 172.17.1.0/24      4        Inter-area 192.168.1.1     1.1.1.1         0.0.0.1        
 192.168.0.0/24     2        Inter-area 192.168.1.1     1.1.1.1         0.0.0.1        
 192.168.1.0/24     1        Direct     192.168.1.2     3.3.3.3         0.0.0.1        
 192.168.2.0/24     3        Inter-area 192.168.1.1     1.1.1.1         0.0.0.1        
 Total Nets: 6
 Intra Area: 2  Inter Area: 4  ASE: 0  NSSA: 0
          OSPF Process 65534 with Router ID 128.1.138.137
                   Routing Tables
 Routing for Network
 Destination        Cost     Type       NextHop         AdvRouter       Area           
 128.1.138.137/32   0        Direct     128.1.138.137   128.1.138.137   0.0.0.0        
 128.1.138.138/32   100      Stub       128.1.138.138   128.1.138.138   0.0.0.0        
 128.1.138.138/32   100      Stub       128.1.138.138   128.1.138.138   0.0.0.0        
 128.1.138.139/32   100      Stub       128.1.138.139   128.1.138.139   0.0.0.0        
 128.1.138.139/32   100      Stub       128.1.138.139   128.1.138.139   0.0.0.0        
 128.1.138.140/32   200      Stub       128.1.138.138   128.1.138.140   0.0.0.0        
 128.1.138.140/32   200      Stub       128.1.138.138   128.1.138.140   0.0.0.0        
 128.1.138.141/32   300      Stub       128.1.138.138   128.1.138.141   0.0.0.0        
 128.1.138.141/32   300      Stub       128.1.138.138   128.1.138.141   0.0.0.0        
 128.1.138.142/32   400      Stub       128.1.138.138   128.1.138.142   0.0.0.0        
 128.1.138.142/32   400      Stub       128.1.138.138   128.1.138.142   0.0.0.0        
 Total Nets: 6
 Intra Area: 6  Inter Area: 0  ASE: 0  NSSA: 0
[~DeviceC] 

说明:当把DeviceC所在区域配置为Stub区域时,已经看不到AS外部的路由,取而代之的是一条缺省路由。

  1. 配置禁止向Stub区域通告Type3 LSA
DeviceA:
ospf 1
 area 0.0.0.1
  stub no-summary
  1. 验证配置结果

查看DeviceC的OSPF路由表。

[~DeviceC]display ospf routing 
          OSPF Process 1 with Router ID 3.3.3.3
                   Routing Tables
 Routing for Network
 Destination        Cost     Type       NextHop         AdvRouter       Area           
 0.0.0.0/0          2        Inter-area 192.168.1.1     1.1.1.1         0.0.0.1        
 172.16.1.0/24      1        Direct     172.16.1.1      3.3.3.3         0.0.0.1        
 192.168.1.0/24     1        Direct     192.168.1.2     3.3.3.3         0.0.0.1        
 Total Nets: 3
 Intra Area: 2  Inter Area: 1  ASE: 0  NSSA: 0
          OSPF Process 65534 with Router ID 128.1.138.137
                   Routing Tables
 Routing for Network
 Destination        Cost     Type       NextHop         AdvRouter       Area           
 128.1.138.137/32   0        Direct     128.1.138.137   128.1.138.137   0.0.0.0        
 128.1.138.138/32   100      Stub       128.1.138.138   128.1.138.138   0.0.0.0        
 128.1.138.138/32   100      Stub       128.1.138.138   128.1.138.138   0.0.0.0        
 128.1.138.139/32   100      Stub       128.1.138.139   128.1.138.139   0.0.0.0        
 128.1.138.139/32   100      Stub       128.1.138.139   128.1.138.139   0.0.0.0        
 128.1.138.140/32   200      Stub       128.1.138.138   128.1.138.140   0.0.0.0        
 128.1.138.140/32   200      Stub       128.1.138.138   128.1.138.140   0.0.0.0        
 128.1.138.141/32   300      Stub       128.1.138.138   128.1.138.141   0.0.0.0        
 128.1.138.141/32   300      Stub       128.1.138.138   128.1.138.141   0.0.0.0        
 128.1.138.142/32   400      Stub       128.1.138.138   128.1.138.142   0.0.0.0        
 128.1.138.142/32   400      Stub       128.1.138.138   128.1.138.142   0.0.0.0        
 Total Nets: 6
 Intra Area: 6  Inter Area: 0  ASE: 0  NSSA: 0
[~DeviceC]

说明:禁止向Stub区域通告Summary LSA后,Stub路由器的路由表项进一步减少,只保留了一条通往区域外部的缺省路由。

 

  • 0
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值