北京金桥世纪H3C认证培训全国总代理

【H3C技术】配置MSTP的基本功能NE路由器

2011-11-15 13:39:41互联网

配置MSTP的基本功能(NE路由器)
应用环境
当网络中存在多个VLAN时,使用STP/RSTP(单生成树算法)无法实现VLAN负载分担,并有可能造成某VLAN报文无法转发。MSTP(多生成树协议)提供多生成树实例,各棵生成树之间彼此独立并分别和相应VLAN对应,每个实例有一个独立于其他生成树实例的生成树拓扑。各生成树实例通过STP\RSTP路径计算,聚合生成一条总生成树。这使网络中每个VLAN都有自己相对应的转发路径,实现整个网络的快速聚合及负载分担。

配置思路
在配置MSTP基本功能时,采用如下的思路配置本配置例:

1.   在路由器上配置MST域(多生成树域),把网络划分为多个区域。

2.   配置路由器在各MSTI(多生成树实例)中的优先级,从而确定它们在各MSTI中的角色。

3.   在边缘接口上配置端口保护功能,提高网络安全性能。

4.   使能路由器的MSTP功能。

配置注意事项
为使网络流量实现负载均衡,所有VLAN到实例映射的分配应保证能通过不同链路传输。否则,所有流量将拥塞在一条单独的链路上。
不推荐把网络分割成大量的区域,如果无法避免,请使用网络子网划分代替区域划分。
配置实例
组网需求
本例采用一个通用组网拓扑图。在如下图所示的网络中,RouterA、RouterC同属于一个区域(R1),RouterB、RouterD同属于另一个区域(R2)。区域内各路由器通过运行多生成树生成协议,计算最短路径生成树。

配置MSTP的基本功能组网图

 【H3C技术】配置MSTP的基本功能NE路由器

适用产品和版本
采用NE40E/80E路由器,版本为(VRP5.30)及后续版本

配置步骤
步骤 1     配置路由器RouterA

# 配置RouterA的MST域。

<RouterA> system-view

[RouterA] stp region-configuration

[RouterA-mst-region] region-name R1

[RouterA-mst-region] instance 1 vlan 1 to 10

# 激活域配置。

[RouterA-mst-region] active region-configuration

[RouterA-mst-region] quit

# 配置RouterA在MSTI0中的优先级为0,保证RouterA作为CIST的总根。

[RouterA] stp instance 0 priority 0

# 配置RouterA在MSTI1中的优先级为0,保证RouterA作为MSTI1的域根。

[RouterA] stp instance 1 priority 0

# 配置端口路径开销的计算方法为华为私有计算方法。

[RouterA] stp pathcost-standard legacy

# 创建VLAN 1到20。

[RouterA] vlan batch 1 to 20

# 将端口6/0/2转换为Trunk接口。

[RouterA] interface gigabitEthernet 6/0/2

[RouterA-GigabitEthernet6/0/2] portswitch

[RouterA-GigabitEthernet6/0/2] port link-type trunk

# 将端口6/0/2加入VLAN。

[RouterA-GigabitEthernet6/0/2] port trunk allow-pass vlan 1 to 20

[RouterA-GigabitEthernet6/0/2] quit

# 将端口6/0/1转换为Trunk接口。

[RouterA] interface gigabitEthernet 6/0/1

[RouterA-GigabitEthernet6/0/1] portswitch

[RouterA-GigabitEthernet6/0/1] port link-type trunk

# 将端口6/0/1加入VLAN。

[RouterA-GigabitEthernet6/0/1] port trunk allow-pass vlan 1 to 20

[RouterA-GigabitEthernet6/0/1] quit

# 在端口6/0/2上启动根保护。

[RouterA] interface gigabitEthernet 6/0/2

[RouterA-GigabitEthernet6/0/2] stp root-protection

[RouterA-GigabitEthernet6/0/2] quit

# 在端口6/0/1上启动根保护。

[RouterA] interface gigabitEthernet 6/0/1

[RouterA-GigabitEthernet6/0/1] stp root-protection

[RouterA-GigabitEthernet6/0/1] quit

# 启动MSTP。

[RouterA] stp enable

说明

每个生成树实例的根路由器应该是一台骨干或者分发路由器,建议不要配置一个边缘路由器作为生成树主根。

步骤 2     配置路由器RouterB

# 配置RouterB的MST域。

[RouterB] stp region-configuration

[RouterB-mst-region] region-name R2 

[RouterB-mst-region] instance 1 vlan 1 to 10

# 激活域配置。

[RouterB-mst-region] active region-configuration

[RouterB-mst-region] quit

# 配置RouterB在MSTI0中的优先级为4096,保证RouterB作为CIST的域根。

[RouterB] stp instance 0 priority 4096

# 配置端口路径的开销计算方法为华为私有计算方法。

[RouterB] stp pathcost-standard legacy

# 创建VLAN 1到20。

[RouterB] vlan batch 1 to 20

# 将端口6/0/2转换为Trunk接口。

[RouterB] interface gigabitEthernet 6/0/2

[RouterB-GigabitEthernet6/0/2] portswitch

[RouterA-GigabitEthernet6/0/2] port link-type trunk

# 将端口6/0/2加入VLAN。

[RouterB-GigabitEthernet6/0/2] port trunk allow-pass vlan 1 to 20

[RouterB-GigabitEthernet6/0/2] quit

# 将端口6/0/1转换为Trunk接口。

[RouterB] interface gigabitEthernet 6/0/1

[RouterB-GigabitEthernet6/0/1] portswitch

[RouterA-GigabitEthernet6/0/1] port link-type trunk

# 将端口6/0/1加入VLAN。

[RouterB-GigabitEthernet6/0/1] port trunk allow-pass vlan 1 to 20

[RouterB-GigabitEthernet6/0/1] quit

# 启动MSTP。

[RouterB] stp enable

步骤 3     配置RouterC

# 配置RouterC的MST域。

[RouterC] stp region-configuration

[RouterC-mst-region] region-name R1

[RouterC-mst-region] instance 1 vlan 1 to 10

# 激活域配置。

[RouterC-mst-region] active region-configuration

[RouterC-mst-region] quit

# 启动BPDU保护功能

[RouterC] stp bpdu-protection

# 创建VLAN 1到20。

[RouterC] vlan batch 1 to 20

# 将端口1/0/2转换为Hybrid接口。

[RouterC] interface gigabitEthernet 1/0/2

[RouterC-GigabitEthernet1/0/2] port link-type hybrid

# 将端口1/0/2加入VLAN。

[RouterC-GigabitEthernet1/0/2] port trunk allow-pass vlan 2 to 20

[RouterC-GigabitEthernet1/0/2] quit

# 将端口1/2/1转换为Hybrid接口。

[RouterC] interface gigabitEthernet 1/2/1

[RouterC-GigabitEthernet1/2/1] port link-type hybrid

# 将端口1/2/1加入VLAN。

[RouterC-GigabitEthernet1/2/1] port trunk allow-pass vlan 2 to 20

[RouterC-GigabitEthernet1/2/1] quit

# 将端口1/0/1配置成边缘端口。

[RouterC] interface gigabitEthernet 1/0/1

[RouterC-GigabitEthernet1/0/1] stp edged-port enable

[RouterC-GigabitEthernet1/0/1] quit

# 启动MSTP。

[RouterC] stp enable

步骤 4     配置RouterD

# 配置RouterD的MST域。

[RouterD] stp region-configuration

[RouterD-mst-region] region-name R2

[RouterD-mst-region] instance 1 vlan 1 to 10

# 激活域配置。

[RouterD-mst-region] active region-configuration

[RouterD-mst-region] quit

# 配置RouterD在MSTI1中的优先级为0,保证RouterD做为MSTI1的域根。

[RouterD] stp instance 1 priority 0

# 启动BPDU保护功能。

[RouterD] stp bpdu-protection

# 创建VLAN 1到20。

[RouterD] vlan batch 1 to 20

# 将端口1/0/2转换为Hybrid接口。

[RouterD] interface gigabitEthernet 1/0/2

[RouterD-GigabitEthernet1/0/2] port link-type hybrid

# 将端口1/0/2加入VLAN。

[RouterD-GigabitEthernet1/0/2] port trunk allow-pass vlan 2 to 20

[RouterD-GigabitEthernet1/0/2] quit

# 将端口1/2/1转换为Hybrid接口。

[RouterD] interface gigabitEthernet 1/2/1

[RouterD-GigabitEthernet1/2/1] port link-type hybrid

# 将端口1/2/1加入VLAN。

[RouterD-GigabitEthernet1/2/1] port trunk allow-pass vlan 2 to 20

[RouterD-GigabitEthernet1/2/1] quit

# 将端口1/0/1配置成边缘端口。

[RouterD] interface gigabitEthernet 1/0/1

[RouterD-GigabitEthernet1/0/1] stp edged-port enable

[RouterD-GigabitEthernet1/0/1] quit

# 启动MSTP。

[RouterD] stp enable

验证结果
经过以上配置,在网络计算稳定后,执行以下操作,验证配置结果是否正确。

# 在RouterA上执行display stp brief命令,查看端口状态和端口的保护类型,结果如下:

<RouterA> display stp brief

 MSTID      Port                  Role  STP State     Protection

   0        GigabitEthernet6/0/2  DESI  FORWARDING      ROOT

   0        GigabitEthernet6/0/1  DESI  FORWARDING      ROOT

   1        GigabitEthernet6/0/2  DESI  FORWARDING      ROOT

   1        GigabitEthernet6/0/1  DESI  FORWARDING      ROOT

由于路由器RouterA在CIST内优先级最高,所以RouterA被选择为CIST总根,同时它也是R1的域根。RouterA的端口6/0/2和6/0/1在CIST上都是指定端口。

路由器RouterA在MSTI1上的优先级在域R1内最高,所以RouterA被选择为MSTI1的域根。端口6/0/2和6/0/1在MSTI1上都被计算为指定端口。

# 在RouterC上执行display stp interface brief命令,结果如下:

<RouterC> display stp interface GigabitEthernet 1/2/1 brief

 MSTID      Port                    Role  STP State     Protection

   0        GigabitEthernet1/2/1    ROOT  FORWARDING      NONE

   1        GigabitEthernet1/2/1    ROOT  FORWARDING      NONE

<RouterC> display stp interface GigabitEthernet 1/0/2 brief

 MSTID      Port                    Role  STP State     Protection

   0        GigabitEthernet1/0/2    DESI  FORWARDING      NONE

   1        GigabitEthernet1/0/2    DESI  FORWARDING      NONE

RouterC的端口1/2/1在CIST和MSTI1中为根端口。RouterC的另一个端口1/0/2,在CIST和MSTI1中都是指定端口。

# 在路由器RouterB上执行display stp brief命令,结果如下:

<RouterB> display stp brief

 MSTID      Port                  Role  STP State     Protection

   0        GigabitEthernet6/0/2  ROOT  FORWARDING      NONE

   0        GigabitEthernet6/0/1  DESI  FORWARDING      NONE

   1        GigabitEthernet6/0/2  MAST  FORWARDING      NONE

   1        GigabitEthernet6/0/1  ROOT  FORWARDING      NONE

路由器RouterB在CIST上的优先级低于RouterA,端口6/0/2在CIST被计算为根端口。同时因为RouterA和RouterB不属于同一个域,所以端口6/0/2在MSTI1上被计算为Master端口。在MSTI1中,RouterB的优先级低于RouterD,所以端口6/0/1被计算为根端口。RouterB在CIST中的优先级高于RouterD,端口6/0/1在CIST被计算为指定端口。

# 在RouterD上执行display stp interface brief命令,结果如下:

<RouterD> display stp interface GigabitEthernet 1/2/1 brief

 MSTID      Port                    Role  STP State     Protection

   0        GigabitEthernet1/2/1    ROOT  FORWARDING      NONE

   1        GigabitEthernet1/2/1    DESI  FORWARDING      NONE

<RouterD> display stp interface GigabitEthernet 1/0/2 brief

 MSTID      Port                    Role  STP State     Protection

   0        GigabitEthernet1/0/2           ALTE  DISCARDING      NONE

   1        GigabitEthernet1/0/2           ALTE  DISCARDING      NONE

因为RouterD的端口1/0/2在CIST上为Alternate端口,又因为RouterD与RouterC不在同一个域,所以端口1/0/2在MSTI1中的也被选择为Alternate端口。端口1/2/1在CIST为根端口,因为RouterD在MSTI1中的优先级比R2高,所以端口1/2/1在MSTI1上被作为指定端口。

配置文件
RouterA的配置文件
#

 sysname RouterA

#

 vlan batch 1 to 20

#

 stp instance 0 priority 0

 stp instance 1 priority 0

stp pathcost-standard legacy

 stp enable

stp region-configuration

 region-name R1

 instance 1 vlan 1 to 10

 active region-configuration

#

interface GigabitEthernet6/0/2

 portswitch

 port trunk allow-pass vlan 1 to 20

 stp root-protection

#

interface GigabitEthernet6/0/1

 portswitch

 port trunk allow-pass vlan 1 to 20

 stp root-protection

#

return

RouterB的配置文件
#

 sysname RouterB

#

 vlan batch 1 to 20

#

 stp instance 0 priority 4096

stp pathcost-standard legacy

stp enable

stp region-configuration

 region-name R2

 instance 1 vlan 1 to 10

#

interface GigabitEthernet6/0/2

 portswitch

 port trunk allow-pass vlan 1 to 20

#

interface GigabitEthernet6/0/1

 portswitch

 port trunk allow-pass vlan 1 to 20

#

return

RouterC的配置文件
#

 sysname RouterC

#

stp bpdu-protection

 stp enable

stp region-configuration

 region-name R1

 instance 1 vlan 1 to 10

 active region-configuration

#

vlan batch 1 to 20

#

interface GigabitEthernet1/0/1

 stp edged-port enable

#

interface GigabitEthernet1/0/2

port trunk allow-pass vlan 2 to 20

#

interface GigabitEthernet1/2/1

 port link-type hybrid

 port hybrid vlan 2 to 20 tagged

#

return

RouterD的配置文件
#

 sysname RouterD

#

 stp instance 1 priority 0

 stp bpdu-protection

 stp enable

stp region-configuration

 region-name R2

 instance 1 vlan 1 to 20

 active region-configuration

#

vlan batch 1 to 20

#

interface GigabitEthernet1/0/1

 stp edged-port enable

#

interface GigabitEthernet1/0/2

port hybrid vlan 2 to 20 tagged

#

interface GigabitEthernet1/2/1

 port link-type hybrid

 port hybrid vlan 2 to 20 tagged

#

return


·[开课时间]2月6日H3C网络安全认证培训H3CSE-Security认证培训 
·[开课时间]12月19日“H3CSE”高级网络工程师培训脱产班开班 
·[知识课堂]【H3C技术】IPV6 相关概念浅谈 
·[知识课堂]【H3C技术】如何查看Windows操作系统Socket端口占 
·[知识课堂]【H3C技术】S36005600系列交换机中Resilient ARP与 
·[知识课堂]【H3C技术】如何理解SIP re-INVITE 


点击这里给我发消息 点击这里给我发消息 点击这里给我发消息 点击这里给我发消息 点击这里给我发消息


开班信息

7月26

H3CNE认证

热报中

8月16

H3C-IMC认证

热报中

7月26

H3CNE认证

热报中

7月26

H3CIE+认证

热报中

8月16

H3C-IMC认证

热报中

7月26

H3CNE培训

热报中

7月26

H3CSE认证

热报中

8月16

H3C无线

热报中

7月26

H3CSE培训

热报中

8月16

H3CIMC培训

热报中

8月16

H3C无线培训

热报中

8月31

H3CEAD培训

热报中

8月16

H3CPME认证

热报中

8月16

H3C安全认证

热报中

8月16

H3CIMC培训

热报中

8月16

H3C无线培训

热报中

8月09

H3CEAD培训

热报中

8月16

H3CPME认证

热报中

8月16

H3C安全认证

热报中

8月16

H3CIMC培训

热报中

8月09

H3C无线培训

热报中

8月09

H3CEAD培训

热报中

8月09

H3CPME认证

热报中

8月09

H3C安全认证

热报中

点击咨询开班情况>>

在线咨询