OSPF支持Hub-And-Spoke组网典型配置举例

OSPF支持Hub-And-Spoke组网典型配置举例

关键词:OSPFHub-And-Spoke

  要:Hub-And-Spoke组网是一种典型的网络扁平化组网方案。为了使OSPF协议能够更好地支持Hub-And-Spoke组网,H3COSPF协议进行的一系列优化。本文描述了OSPF用于Hub-And-Spoke组网的配置过程

缩略语:

缩略语

英文全名

中文解释

LSA

Link State Advertisement

链路状态通告

LSDB

Link State Database

链路状态数据库

OSPF

Open Shortest Path First

开放最短路径优先

 



特性简介

Hub-And-Spoke组网是一种典型的网络扁平化组网方案,通过Hub设备下连接数量众多的Spoke设备来实现。

OSPF协议支持Hub-And-Spoke组网时,网络规划通常将Hub设备与所有的Spoke设备规划在同一个OSPF区域内,Hub设备与所有的Spoke设备之间维持OSPF邻居关系。此时,Hub设备邻居数量众多,占用大量系统资源,有可能会出现邻居超时、网络收敛时间比较长、影响其他业务正常运行等等问题。

通过对OSPF协议进行优化配置,可以很大程度上缓解这些问题。

配置举例

2.1  组网需求

l              有一个具有500Spoke设备的Hub-And-Spoke组网,Hub设备(Router A)通过OSPF协议与Spoke设备(Router BRouter CRouter DRouter E等)交换路由信息,且所有设备处于同一个OSPF区域中。

l              Spoke设备通过Hub设备访问文件服务器。

设备

接口

IP地址

设备

接口

IP地址

Router A

Eth1/1

10.1.1.1/24

Router B

Eth1/1

10.1.1.2/24

 

Eth1/2

10.1.2.1/24

Router C

Eth1/1

10.1.2.2/24

 

Eth1/3

10.1.3.1/24

Router D

Eth1/1

10.1.3.2/24

 

Eth1/4

10.1.4.1/24

Router E

Eth1/1

10.1.4.2/24

 

Eth1/5

20.1.1.1/24

Server

 

20.1.1.2/24

图1  OSPF支持Hub-And-Spoke配置组网图

2.2  配置思路

(1)        Hub设备与Spoke设备上进行基本的OSPF配置,Hub设备向Spoke设备通告Server所在网段的路由。
(2)        Hub设备上进行下面的配置,使OSPF可以有效支持Hub-And-Spoke组网:

l              配置OSPF优先接收和处理Hello报文。

l              配置接口发送LSU报文的时间间隔和每次最多发送的LSU报文数,保证报文平缓发送。

l              配置LSA重新生成的最大时间间隔、最小时间间隔和惩罚增量,控制LSA的生成。

l              配置SPF计算最大时间间隔、最小时间间隔和惩罚增量,控制进行SPF计算的时间间隔。

2.3  配置步骤

以下配置均是在实验室环境下进行的配置和验证,配置前设备的所有参数均采用出厂时的缺省配置。如果您已经对设备进行了配置,为了保证配置效果,请确认现有配置和以下配置不冲突。

本文档不严格与具体软、硬件版本对应。

 

2.3.1  配置Hub设备

1. 配置步骤

# 启动OSPF同时指定Router ID并进入OSPF视图。

<RouterA> system-view

[RouterA] ospf 1 router-id 1.1.1.1

# 配置OSPF区域1所包含的网段并在指定网段的接口上使能OSPF

[RouterA-ospf-1] area 1

[RouterA-ospf-1-area-0.0.0.1] network 10.0.0.0 0.255.255.255

[RouterA-ospf-1-area-0.0.0.1] network 20.1.1.0 0.0.0.255

[RouterA-ospf-1-area-0.0.0.1] quit

# 配置OSPF优先接收和处理Hello报文。

[RouterA] ospf packet-process prioritized-treatment

# 配置接口发送LSU报文的时间间隔为200毫秒,每次最多10LSU报文。

[RouterA] ospf 1 router-id 1.1.1.1

[RouterA-ospf-1] transmit-pacing interval 200 count 10

# 配置LSA重新生成的最大时间间隔为60秒,最小时间间隔为1000毫秒,惩罚增量为1000毫秒。

[RouterA-ospf-1] lsa-generation-interval 60 1000 1000

# 配置SPF计算最大时间间隔为60秒,最小时间间隔为1000毫秒,惩罚增量为1000毫秒。

[RouterA-ospf-1] spf-schedule-interval 60 1000 1000

2. 配置文件

<RouterA> display current-configuration

#

 version 5.20, Beta 1501L02, Standard

#

 sysname RouterA

#

 configure-user count 50

#

 info-center logfile size-quota 0

#

 domain default enable system

#

 telnet server enable

#

radius scheme system

 server-type extended

 primary authentication 127.0.0.1 1645

 primary accounting 127.0.0.1 1646

 user-name-format without-domain

#

domain system

 access-limit disable

 state active

 idle-cut disable

 self-service-url disable

#

interface Aux0

 async mode flow

 link-protocol ppp

#

interface Ethernet1/1

 port link-mode route

 ip address 10.1.1.1 255.255.255.0

#

interface Ethernet1/2

 port link-mode route

 ip address 10.1.2.1 255.255.255.0

#

interface Ethernet1/3

 port link-mode route

 ip address 10.1.3.1 255.255.255.0

#

interface Ethernet1/4

 port link-mode route

 ip address 10.1.4.1 255.255.255.0

#

interface Ethernet1/5

 port link-mode route

 ip address 20.1.1.1 255.255.255.0

#

#...(此处略去若干相似接口配置)

#

ospf packet-process prioritized-treatment

#

ospf 1 router-id 1.1.1.1

spf-schedule-interval 60 1000 1000

 lsa-generation-interval 60 1000 1000

 transmit-pacing interval 200 count 10

 area 0.0.0.1

  network 10.0.0.0 0.255.255.255

  network 20.1.1.0 0.0.0.255

#

user-interface con 0

user-interface aux 0

 authentication-mode none

 user privilege level 3

user-interface vty 0 4

 authentication-mode none

 user privilege level 3

#

2.3.2  配置Spoke设备

Router BRouter CSpoke设备配置非常类似,这里以Router B为例对Spoke设备的配置进行说明,其它Spoke设备的配置不再赘述。

1. 配置步骤

# 启动OSPF同时指定Router ID并进入OSPF视图。

<RouterB> system-view

[RouterB] ospf 1 router-id 2.2.2.2

# 指定运行OSPF协议的接口Ethernet1/1IP地址位于网段10.0.0.0/24,接口所在的OSPF区域ID1

[RouterB-ospf-1] area 1

[RouterB-ospf-1-area-0.0.0.1] network 10.0.0.0 0.255.255.255

2. 配置文件

<RouterB> display current-configuration

#

 version 5.20, Beta 1501L02, Standard

#

 sysname RouterB

#

 configure-user count 50

#

 info-center logfile size-quota 0

#

 domain default enable system

#

 telnet server enable

#

radius scheme system

 server-type extended

 primary authentication 127.0.0.1 1645

 primary accounting 127.0.0.1 1646

 user-name-format without-domain

#

domain system

 access-limit disable

 state active

 idle-cut disable

 self-service-url disable

#

interface Aux0

 async mode flow

 link-protocol ppp

#

interface Ethernet1/1

 port link-mode route

 ip address 10.1.1.2 255.255.255.0

#

ospf 1 router-id 2.2.2.2

 area 0.0.0.1

  network 10.0.0.0 0.255.255.255

#

user-interface con 0

user-interface aux 0

 authentication-mode none

 user privilege level 3

user-interface vty 0 4

 authentication-mode none

 user privilege level 3

#

2.3.3  验证结果

按照如上配置,Hub设备与Spoke设备在区域1形成Full的邻居关系,Spoke设备学习到Hub设备发布的Server所在网段的路由。

(1)        查看Router A的邻居关系统计信息。

<RouterA> display ospf peer statistics

          OSPF Process 1 with Router ID 1.1.1.1

                    Neighbor Statistics

 

  Area ID      Down Attempt Init 2-Way ExStart Exchange Loading Full Total

  0.0.0.1      0    0       0    0     0       0        0       500  500

  Total        0    0       0    0     0       0        0       500  500

可以看出,Router A共有500个邻居(状态都为Full)。

(2)        查看Router B的邻居信息。

<RouterB> display ospf peer

 

                   OSPF Process 1 with Router ID 2.2.2.2

                        Neighbor Brief Information

 

 Area: 0.0.0.1

 Router ID       Address         Pri Dead-Time Interface       State

 1.1.1.1         10.1.1.1        1   35        Eth1/1          Full/BDR

可以看出,Router B的邻居路由器为Router A

(3)        Router B上计算出Router A发布的Server所在的网段路由,查看Router B的路由信息。

<RouterB> display ip routing-table

Routing Tables: Public

         Destinations : 5        Routes : 5

Destination/Mask    Proto  Pre  Cost         NextHop         Interface

10.1.1.0/24         Direct 0    0            10.1.1.2        Eth1/1

10.1.1.2/32         Direct 0    0            127.0.0.1       InLoop0

20.1.1.0/24         OSPF   10   2            10.1.1.1        Eth1/1

127.0.0.0/8         Direct 0    0            127.0.0.1       InLoop0

127.0.0.1/32        Direct 0    0            127.0.0.1       InLoop0

可以看出,Router B到达文件服务器的下一跳为Router A,即通过Router A访问文件服务器。

(4)        Router CRouter DRouter E等其它Spoke设备的邻居情况和路由情况与Router B类似,这里不在赘述。

相关资料

3.1  相关协议和标准

l              RFC 2328OSPF Version 2

l              RFC 4222Prioritized Treatment of Specific OSPF Version 2 Packets and Congestion Avoidance

3.2  相关文献

OSPF支持Hub-And-Spoke组网技术白皮书

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Copyright ©2009 杭州华三通信技术有限公司 版权所有,保留一切权利。

非经本公司书面许可,任何单位和个人不得擅自摘抄、复制本文档内容的部分或全部,并不得以任何形式传播。

本文档中的信息可能变动,恕不另行通知。

 

联系我们