Chinaunix首页 | 论坛 | 博客
  • 博客访问: 3444225
  • 博文数量: 349
  • 博客积分: 5771
  • 博客等级: 大校
  • 技术积分: 4193
  • 用 户 组: 普通用户
  • 注册时间: 2009-07-06 11:52
个人简介

it

文章分类

全部博文(349)

文章存档

2019年(2)

2018年(2)

2017年(1)

2016年(2)

2015年(18)

2014年(36)

2013年(69)

2012年(100)

2011年(62)

2010年(57)

分类:

2012-12-20 17:29:34

一、目的
熟悉ospf的stub区域对路由信息的影响。
二、top网络环境
三、配置思路
1、先配置普通区域和主干区域,记录各路由器的lsdb数据库;
2、在将area1配置为stub区域。再看各路由器的lsdb数据库变化情况。
四、配置过程
以swc为例说明,其他类似。为模拟3,4,5类,在swd上配置静态路由并在ospf中引入。
 system-view 

[SwitchC] ospf 1 router-id 3.3.3.3
[SwitchC-ospf-1] area 1
[SwitchC-ospf-1-area-0.0.0.1] network 10.2.1.0 0.0.0.255
[SwitchC-ospf-1-area-0.0.0.1] network 10.4.1.0 0.0.0.255

 配置 Switch D
#
创建 VLAN ,配置接口 IP 地址,配置过程略

# 配置到目的网络 1.0.0.0/8 的静态路由
system-view
[SwitchD] ip route-static 1.0.0.0 8 10.5.1.2

# 在普通区域配置 OSPF
[SwitchD] ospf 1 router-id 4.4.4.4
[SwitchD-ospf-1] area 2
[SwitchD-ospf-1-area-0.0.0.2] network 10.3.1.0 0.0.0.255
[SwitchD-ospf-1-area-0.0.0.2] network 10.5.1.0 0.0.0.255
[SwitchD-ospf-1-area-0.0.0.2] quit

# 引入静态路由,将 Switch D 指定为 ASBR
[SwitchD-ospf-1] import-route static

 说明:
以上的配置步骤完成了普通区域、骨干区域、 ABR/ASBR 的配置。

Switch C 上使用 display ospf lsdb 命令可以看到链路状态数据库中存在

Type-3 LSAs Type-4 LSAs Type-5 LSAs 。通过在设备配置 Stub 属性,可以

控制 Type-4 LSAs Type-5 LSAs 生成。
查看各路由器的lsdb:

dis ospf lsdb 
 OSPF Process 1 with Router ID 1.1.1.1

Link State Database 
        Area: 0.0.0.0

 Type      LinkState ID    AdvRouter          Age  Len   Sequence   Metric

 Router    2.2.2.2         2.2.2.2            296  36    80000004       1

 Router    1.1.1.1         1.1.1.1            292  36    80000006       1

 Network   10.1.1.1        1.1.1.1            293  32    80000003       0

 Sum-Net   10.3.1.0        2.2.2.2            305  28    80000002       1

 Sum-Net   10.4.1.0        1.1.1.1            334  28    80000002       2

 Sum-Net   10.5.1.0        2.2.2.2            118  28    80000002       2

 Sum-Net   10.2.1.0        1.1.1.1            336  28    80000002       1

 Sum-Asbr  4.4.4.4         2.2.2.2           1746  28    80000001       1

        Area: 0.0.0.1

 Type      LinkState ID    AdvRouter          Age  Len   Sequence   Metric

 Router    1.1.1.1         1.1.1.1            648  36    80000006       1

 Router    3.3.3.3         3.3.3.3            294  48    80000009       1

 Network   10.2.1.1        1.1.1.1            648  32    80000003       0

 Sum-Net   10.3.1.0        1.1.1.1            294  28    80000002       2

 Sum-Net   10.5.1.0        1.1.1.1            118  28    80000002       3

 Sum-Net   10.1.1.0        1.1.1.1            336  28    80000002       1

 Sum-Asbr  4.4.4.4         1.1.1.1           1745  28    80000001       2

  AS External Database

 Type      LinkState ID    AdvRouter          Age  Len   Sequence   Metric

 External  1.0.0.0         4.4.4.4           1396  36    80000001       1

dis ospf lsdb 

OSPF Process 1 with Router ID 2.2.2.2

Link State Database 

        Area: 0.0.0.0

 Type      LinkState ID    AdvRouter          Age  Len   Sequence   Metric

 Router    2.2.2.2         2.2.2.2            352  36    80000004       1

 Router    1.1.1.1         1.1.1.1            350  36    80000006       1

 Network   10.1.1.1        1.1.1.1            351  32    80000003       0

 Sum-Net   10.3.1.0        2.2.2.2            361  28    80000002       1

 Sum-Net   10.4.1.0        1.1.1.1            392  28    80000002       2

 Sum-Net   10.5.1.0        2.2.2.2            174  28    80000002       2

 Sum-Net   10.2.1.0        1.1.1.1            394  28    80000002       1

 Sum-Asbr  4.4.4.4         2.2.2.2              2  28    80000002       1

          Area: 0.0.0.2

 Type      LinkState ID    AdvRouter          Age  Len   Sequence   Metric

 Router    4.4.4.4         4.4.4.4              3  48    80000008       1

 Router    2.2.2.2         2.2.2.2            180  36    80000006       1

 Network   10.3.1.1        2.2.2.2            180  32    80000003       0

 Sum-Net   10.4.1.0        2.2.2.2            351  28    80000002       3

 Sum-Net   10.1.1.0        2.2.2.2            361  28    80000002       1

 Sum-Net   10.2.1.0        2.2.2.2            351  28    80000002       2

  AS External Database

 Type      LinkState ID    AdvRouter          Age  Len   Sequence   Metric

 External  1.0.0.0         4.4.4.4           1451  36    80000001       1

dis ospf lsdb 
OSPF Process 1 with Router ID 3.3.3.3
Link State Database 
        Area: 0.0.0.1
 Type      LinkState ID    AdvRouter          Age  Len   Sequence   Metric
 Router    1.1.1.1         1.1.1.1            755  36    80000006       1
 Router    3.3.3.3         3.3.3.3            399  48    80000009       1
 Network   10.2.1.1        1.1.1.1            755  32    80000003       0
 Sum-Net   10.3.1.0        1.1.1.1            401  28    80000002       2
 Sum-Net   10.5.1.0        1.1.1.1            225  28    80000002       3
 Sum-Net   10.1.1.0        1.1.1.1            443  28    80000002       1
 Sum-Asbr  4.4.4.4         1.1.1.1             52  28    80000002       2
AS External Database
 Type      LinkState ID    AdvRouter          Age  Len   Sequence   Metric
 External  1.0.0.0         4.4.4.4           1503  36    80000001       1
dis ospf lsdb 
OSPF Process 1 with Router ID 4.4.4.4
Link State Database 
        Area: 0.0.0.2
 Type      LinkState ID    AdvRouter          Age  Len   Sequence   Metric
 Router    4.4.4.4         4.4.4.4             83  48    80000008       1
 Router    2.2.2.2         2.2.2.2            262  36    80000006       1
 Network   10.3.1.1        2.2.2.2            262  32    80000003       0
 Sum-Net   10.4.1.0        2.2.2.2            433  28    80000002       3
 Sum-Net   10.1.1.0        2.2.2.2            443  28    80000002       1
 Sum-Net   10.2.1.0        2.2.2.2            433  28    80000002       2
  AS External Database
 Type      LinkState ID    AdvRouter          Age  Len   Sequence   Metric
 External  1.0.0.0         4.4.4.4           1532  36    80000001       1
以上为没有配置area1为stub的情况。
在以上的基础上进行stub的配置

 Stub 区域配置(区域 Area1 Stub 区域)

在 普通区域和骨干区域配置(区域 Area1 为普通区域)基础上进行如下配置:

# 将区域 Area1 配置为 Stub 区域

 [SwitchA-ospf-1-area-0.0.0.1] stub
[SwitchC-ospf-1-area-0.0.0.1] stub

说明:
以上的配置步骤完成了 Stub 区域的配置。

Switch C 上使用 display ospf lsdb 命令查看链路状态数据库, 看到数据库中已

经不存在 Type-4 LSAs Type-5 LSAs 。 但是与普通区域相比, 增加了 Type-3

LSAs

 dis ospf lsdb 

OSPF Process 1 with Router ID 3.3.3.3

Link State Database 

        Area: 0.0.0.1

 Type      LinkState ID    AdvRouter          Age  Len   Sequence   Metric

 Router    1.1.1.1         1.1.1.1              9  36    80000006       1

 Router    3.3.3.3         3.3.3.3             13  48    80000004       1

 Network   10.2.1.1        1.1.1.1              9  32    80000002       0

 Sum-Net   0.0.0.0         1.1.1.1             68  28    80000001       1

 Sum-Net   10.3.1.0        1.1.1.1             68  28    80000001       2

 Sum-Net   10.5.1.0        1.1.1.1             68  28    80000001       3

 Sum-Net   10.1.1.0        1.1.1.1             68  28    80000001       1

 dis ospf lsdb 

OSPF Process 1 with Router ID 1.1.1.1

Link State Database 

        Area: 0.0.0.0

 Type      LinkState ID    AdvRouter          Age  Len   Sequence   Metric

 Router    2.2.2.2         2.2.2.2            866  36    80000004       1

 Router    1.1.1.1         1.1.1.1            862  36    80000006       1

 Network   10.1.1.1        1.1.1.1            863  32    80000003       0

 Sum-Net   10.3.1.0        2.2.2.2            875  28    80000002       1

 Sum-Net   10.4.1.0        1.1.1.1            112  28    80000001       2

 Sum-Net   10.5.1.0        2.2.2.2            688  28    80000002       2

 Sum-Net   10.2.1.0        1.1.1.1            166  28    80000003       1

 Sum-Asbr  4.4.4.4         2.2.2.2            516  28    80000002       1

          Area: 0.0.0.1

 Type      LinkState ID    AdvRouter          Age  Len   Sequence   Metric

 Router    1.1.1.1         1.1.1.1            107  36    80000006       1

 Router    3.3.3.3         3.3.3.3             75  48    80000005       1

 Network   10.2.1.1        1.1.1.1            107  32    80000002       0

 Sum-Net   0.0.0.0         1.1.1.1            166  28    80000001       1

 Sum-Net   10.3.1.0        1.1.1.1            166  28    80000001       2

 Sum-Net   10.5.1.0        1.1.1.1            166  28    80000001       3

 Sum-Net   10.1.1.0        1.1.1.1            166  28    80000001       1

AS External Database
 Type      LinkState ID    AdvRouter          Age  Len   Sequence   Metric
 External  1.0.0.0         4.4.4.4            166  36    80000002       1

这里可以好好理解stub了吧?
接着可以配置total stub。

 Totally Stub 区域配置(区域 Area1 Totally Stub 区域)

在 普通区域和骨干区域配置(区域 Area1 为普通区域)基础上进行如下配置:

# 将区域 Area1 配置为 Totally Stub 区域
[SwitchA-ospf-1-area-0.0.0.1] stub no-summary
[SwitchC-ospf-1-area-0.0.0.1] stub  
no-summary

说明:
以上的配置步骤完成了 Totally Stub 区域的配置。

Stub 区域配置为 Totally Stub 区域时,只需在 Stub 区域的 ABR 上配置 stub

no-summary 命令。
Switch C 上使用 display ospf lsdb 命令查看链路状态数据库, 看到数据库中已

经不存在 Type-3 LSAs Type-4 LSAs Type-5 LSAs 。但是与普通区域相比,
增加了
Type-3 缺省 LSAs 。 

dis ospf lsdb 
OSPF Process 1 with Router ID 1.1.1.1
Link State Database 
        Area: 0.0.0.0
 Type      LinkState ID    AdvRouter          Age  Len   Sequence   Metric
 Router    2.2.2.2         2.2.2.2           1154  36    80000004       1
 Router    1.1.1.1         1.1.1.1           1150  36    80000006       1
 Network   10.1.1.1        1.1.1.1           1151  32    80000003       0
 Sum-Net   10.3.1.0        2.2.2.2           1163  28    80000002       1
 Sum-Net   10.4.1.0        1.1.1.1             12  28    80000001       2
 Sum-Net   10.5.1.0        2.2.2.2            976  28    80000002       2
 Sum-Net   10.2.1.0        1.1.1.1             47  28    80000004       1
 Sum-Asbr  4.4.4.4         2.2.2.2            804  28    80000002       1
          Area: 0.0.0.1
 Type      LinkState ID    AdvRouter          Age  Len   Sequence   Metric
 Router    1.1.1.1         1.1.1.1              5  36    8000000B       1
 Router    3.3.3.3         3.3.3.3             15  48    8000000A       1
 Network   10.2.1.1        1.1.1.1              5  32    80000002       0
 Sum-Net   0.0.0.0         1.1.1.1             47  28    80000001       1
  AS External Database
 Type      LinkState ID    AdvRouter          Age  Len   Sequence   Metric
 External  1.0.0.0         4.4.4.4            454  36    80000002       1
dis ospf lsdb 
OSPF Process 1 with Router ID 3.3.3.3
Link State Database 
        Area: 0.0.0.1
 Type      LinkState ID    AdvRouter          Age  Len   Sequence   Metric
 Router    1.1.1.1         1.1.1.1             61  36    8000000B       1
 Router    3.3.3.3         3.3.3.3             31  48    8000000B       1
 Network   10.2.1.1        1.1.1.1             61  32    80000002       0
 Sum-Net   0.0.0.0         1.1.1.1            104  28    80000001       1


  




  






阅读(3889) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~