标签:
本示例拓扑结构如图8-38所示,SwitchA、SwitchB、SwitchC和SwitchD都运行MSTP。它们彼此相连形成了一个环网,因为在SwitchA与SwitchB之间,以及SwitchC与SwitchD之间都存在冗余链路。为实现VLAN2~VLAN10和VLAN11~VLAN20的流量负载分担,本示例采用MSTP协议配置了两个MSTI,即MSTI1和MSTI2。
(1)在四台交换机创建一个相同的MST域,然后在这个MST域中创建两个MSTI(MSTI1和MSTI2),它们的生成树拓扑参见图8-38。把ID号为2~20的VLAN映射到MSTI1中,把ID号为11~20的VLAN映射到MSTI2中。
(2)为了实现两个MSTI无二层环路,在MSTI1中阻塞了SwitchD上的GE0/0/2端口,在MSTI2中阻塞了SwitchC上的GE0/0/2端口。
(3)配置MSTI的根桥为SwitchA,MSTI2的根桥为SwitchB,这样就实现了MSTI1中的VLAN2~VLAN10和MSTI2中的VLAN11~VLAN20的流量通过上行两条链路进行负载分担。
(4)最后在这台交换机上启用MSTP协议,使以上配置生交效。
(5)为了确保两个MSTI中的根桥不会发生变化,分别在SwitchA和SwitchB两指定端口上配置根保护功能。
(6)在各交换机上创建ID号为2~20的共19个VLAN,配置各链路间端口的类型,并允许对应的VLAN通过。之所以要把VLAN的创建与配置放在最后,就是为了预防环路的发生,因为如果在启用MSTP协议前创建了这些VLAN,肯定会发生二层环路的,也起不到负载分担的目的。
根据以上配置思路,下面具体介绍它们的配置步骤。
(1)在四台交换机上分别创建一个相同的MST域(域名假设为RG1)、两个多生树实例MSTI1和MSTI2,然后创建ID为2~10的VLAN映射到MSTI1的映射,创建ID为11~20的VLAN映射到MSTI2的映射。并激活MST域配置。
SwitchA上的MST域配置:
<HUAWEI> system-view
[HUAWEI] sysname SwitchA
[SwitchA] stp region-configuration
[SwitchA-mst-region] region-name RG1
[SwitchA-mst-region] instance 1 vlan 2 to 10
[SwitchA-mst-region] instance 2 vlan 11 to 20
[SwitchA-mst-region] active region-configuration
[SwitchA-mst-region] quit
SwitchB上的MST域配置:
<HUAWEI> system-view
[HUAWEI] sysname SwitchB
[SwitchB] stp region-configuration
[SwitchB-mst-region] region-name RG1
[SwitchB-mst-region] instance 1 vlan 2 to 10
[SwitchB-mst-region] instance 2 vlan 11 to 20
[SwitchB-mst-region] active region-configuration
[SwitchB-mst-region] quit
SwitchC上的MST域配置:
<HUAWEI> system-view
[HUAWEI] sysname SwitchC
[SwitchC] stp region-configuration
[SwitchC-mst-region] region-name RG1
[SwitchC-mst-region] instance 1 vlan 2 to 10
[SwitchC-mst-region] instance 2 vlan 11 to 20
[SwitchC-mst-region] active region-configuration
[SwitchC-mst-region] quit
SwitchD上的MST域配置:
<HUAWEI> system-view
[HUAWEI] sysname SwitchD
[SwitchD] stp region-configuration
[SwitchD-mst-region] region-name RG1
[SwitchD-mst-region] instance 1 vlan 2 to 10
[SwitchD-mst-region] instance 2 vlan 11 to 20
[SwitchD-mst-region] active region-configuration
[SwitchD-mst-region] quit
(2)配置MSTI1与MSTI2的根桥与备份根桥。
[SwitchA] stp instance 1 root primary #--- 配置SwitchA为MSTI1的根桥
[SwitchB] stp instance 1 root secondary #---配置SwitchB为MSTI1的备份根桥
[SwitchB] stp instance 2 root primary
[SwitchA] stp instance 2 root secondary
(3)配置MSTI1和MSTI2中要被阻塞的端口,以便消除二层环路。
因为本示例中其它端口都是采用对应类型端口的缺省路径开销值,所以要阻塞某端口时只需要把它们的路径开销值配置为大于缺省值即可。路径开销值越大,成为根端口的可能性就越小。
端口路径开销值取值范围由路径开销计算方法决定,这里选择使用华为私有计算方法为例,配置实例MSTI1和MSTI2中将被阻塞的端口(分别为SwitchD中的GE0/0/2和SwitchC中的GE0/0/2端口)的路径开销值为20000(千兆以太网端口路径开销值的缺省值为2)。要求同一网络内所有交换设备的端口路径开销应使用相同的计算方法。下面依次是SwitchA、SwitchB、SwitchC和SwitchD这四台交换机上端口路径开销的相关配置。
[SwitchA] stp pathcost-standard legacy #---配置采用华为的私有端口路径开销计算方法
[SwitchB] stp pathcost-standard legacy
[SwitchC] stp pathcost-standard legacy
[SwitchC] interface gigabitethernet 0/0/2
[SwitchC-GigabitEthernet0/0/2] stp instance 2 cost 20000 #---将端口GE0/0/2在实例MSTI2中的路径开销值配置为20000
[SwitchC-GigabitEthernet0/0/2] quit
[SwitchD] stp pathcost-standard legacy
[SwitchD] interface gigabitethernet 0/0/2
[SwitchD-GigabitEthernet0/0/2] stp instance 1 cost 20000
[SwitchD-GigabitEthernet0/0/2] quit
(4)在四台交换机上全局使能MSTP,使以上MSTP配置生效,消除二层环路。
[SwitchA] stp enable
[SwitchB] stp enable
[SwitchC] stp enable
[SwitchD] stp enable
(5)将与终端PC相连的端口去使能MSTP。
[SwitchC] interface gigabitethernet 0/0/1
[SwitchC-GigabitEthernet0/0/1] stp disable
[SwitchC-GigabitEthernet0/0/1] quit
[SwitchD] interface gigabitethernet 0/0/1
[SwitchD-GigabitEthernet0/0/1] stp disable
[SwitchD-GigabitEthernet0/0/1] quit
(6)在两实例的根桥设备的指定端口上配置根保护功能。
[SwitchA] interface gigabitethernet 0/0/1
[SwitchA-GigabitEthernet0/0/1] stp root-protection
[SwitchA-GigabitEthernet0/0/1] quit
[SwitchB] interface gigabitethernet 0/0/1
[SwitchB-GigabitEthernet0/0/1] stp root-protection
[SwitchB-GigabitEthernet0/0/1] quit
(7)最后在各交换机上创建ID号为2~20的共19个VLAN,然后把四台交换机间的直连链路的端口配置为Trunk类型,并允许这19个VLAN通过。把连接PC的链路端口设置为Access类型,加入对应的VLAN。有关VLAN的具体创建和配置方法参见本书第6章。
SwitchA上的配置:
[SwitchA] vlan batch 2 to 20
[SwitchA] interface gigabitethernet 0/0/1
[SwitchA-GigabitEthernet0/0/1] port link-type trunk
[SwitchA-GigabitEthernet0/0/1] port trunk allow-pass vlan 2 to 20
[SwitchA-GigabitEthernet0/0/1] quit
[SwitchA] interface gigabitethernet 0/0/2
[SwitchA-GigabitEthernet0/0/2] port link-type trunk
[SwitchA-GigabitEthernet0/0/2] port trunk allow-pass vlan 2 to 20
[SwitchA-GigabitEthernet0/0/2] quit
SwitchB上的配置:
[SwitchB] vlan batch 2 to 20
[SwitchB] interface gigabitethernet 0/0/1
[SwitchB-GigabitEthernet0/0/1] port link-type trunk
[SwitchB-GigabitEthernet0/0/1] port trunk allow-pass vlan 2 to 20
[SwitchB-GigabitEthernet0/0/1] quit
[SwitchB] interface gigabitethernet 0/0/2
[SwitchB-GigabitEthernet0/0/2] port link-type trunk
[SwitchB-GigabitEthernet0/0/2] port trunk allow-pass vlan 2 to 20
[SwitchB-GigabitEthernet0/0/2] quit
SwitchC上的配置:
[SwitchC] vlan batch 2 to 20
[SwitchC] interface gigabitethernet 0/0/1
[SwitchC-GigabitEthernet0/0/1] port link-type access
[SwitchC-GigabitEthernet0/0/1] port default vlan 2
[SwitchC-GigabitEthernet0/0/1] quit
[SwitchC] interface gigabitethernet 0/0/2
[SwitchC-GigabitEthernet0/0/2] port link-type trunk
[SwitchC-GigabitEthernet0/0/2] port trunk allow-pass vlan 2 to 20
[SwitchC-GigabitEthernet0/0/2] quit
[SwitchC] interface gigabitethernet 0/0/3
[SwitchC-GigabitEthernet0/0/3] port link-type trunk
[SwitchC-GigabitEthernet0/0/3] port trunk allow-pass vlan 2 to 20
[SwitchC-GigabitEthernet0/0/3] quit
SwitchD上的配置:
[SwitchD] vlan batch 2 to 20
[SwitchD] interface gigabitethernet 0/0/1
[SwitchD-GigabitEthernet0/0/1] port link-type access
[SwitchD-GigabitEthernet0/0/1] port default vlan 11
[SwitchD-GigabitEthernet0/0/1] quit
[SwitchD] interface gigabitethernet 0/0/2
[SwitchD-GigabitEthernet0/0/2] port link-type trunk
[SwitchD-GigabitEthernet0/0/2] port trunk allow-pass vlan 2 to 20
[SwitchD-GigabitEthernet0/0/2] quit
[SwitchD] interface gigabitethernet 0/0/3
[SwitchD-GigabitEthernet0/0/3] port link-type trunk
[SwitchD-GigabitEthernet0/0/3] port trunk allow-pass vlan 2 to 20
[SwitchD-GigabitEthernet0/0/3] quit
经过以上配置,在网络计算稳定后可使用以下display命令验证配置结果。如在SwitchA上执行display stp brief命令可查看端口状态和端口的保护类型,结果如下。从中可以看到,在MSTI1中,由于SwitchA是根桥,其GE0/0/2和GE0/0/1端口成为指定端口(其中在GE0/0/1端口上配置了根保护);在MSTI2中,SwitchA为非根桥,其GE0/0/1端口成为指定端口,端口GE0/0/2端口成为根端口。符合本示例中两MSTI生成树拓扑要求。
[SwitchA] display stp brief
MSTID Port Role STP State Protection
0 GigabitEthernet0/0/1 DESI FORWARDING ROOT
0 GigabitEthernet0/0/2 DESI FORWARDING NONE
1 GigabitEthernet0/0/1 DESI FORWARDING ROOT
1 GigabitEthernet0/0/2 DESI FORWARDING NONE
2 GigabitEthernet0/0/1 DESI FORWARDING ROOT
2 GigabitEthernet0/0/2 ROOT FORWARDING NONE
在SwitchB上执行display stp brief命令,结果如下。从中可以看到,在MSTI2中,由于SwitchB是根桥,其GE0/0/1和GE0/0/2端口为指定端口(其中在GE0/0/1端口上配置了根保护);在MSTI1中,SwitchB为非根桥,其GE0/0/1端口成为指定端口, GE0/0/2端口成为根端口。符合本示例中两MSTI生成树拓扑要求。
[SwitchB] display stp brief
MSTID Port Role STP State Protection
0 GigabitEthernet0/0/1 DESI FORWARDING ROOT
0 GigabitEthernet0/0/2 ROOT FORWARDING NONE
1 GigabitEthernet0/0/1 DESI FORWARDING ROOT
1 GigabitEthernet0/0/2 ROOT FORWARDING NONE
2 GigabitEthernet0/0/1 DESI FORWARDING ROOT
2 GigabitEthernet0/0/2 DESI FORWARDING NONE
在SwitchC上执行display stp interface brief命令,结果如下。从中可以看到,SwitchC的GE0/0/3端口在MSTI1和MSTI2中均为根端口,GE0/0/2端口在MSTI2中被阻塞,在MSTI1中被计算为指定端口。也符合本示例中两MSTI生成树拓扑要求。
[SwitchC] display stp interface gigabitethernet 0/0/3 brief
MSTID Port Role STP State Protection
0 GigabitEthernet0/0/3 ROOT FORWARDING NONE
1 GigabitEthernet0/0/3 ROOT FORWARDING NONE
2 GigabitEthernet0/0/3 ROOT FORWARDING NONE
[SwitchC] display stp interface gigabitethernet 0/0/2 brief
MSTID Port Role STP State Protection
0 GigabitEthernet0/0/2 DESI FORWARDING NONE
1 GigabitEthernet0/0/2 DESI FORWARDING NONE
2 GigabitEthernet0/0/2 ALTE DISCARDING NONE
在SwitchD上执行display stp interface brief命令,结果如下。从中可以看到,SwitchD的GE0/0/3端口在MSTI1和MSTI2中均为根端口,GE0/0/2端口在MSTI1中被阻塞,在MSTI2中被计算为指定端口。
[SwitchD] display stp interface gigabitethernet 0/0/3 brief
MSTID Port Role STP State Protection
0 GigabitEthernet0/0/3 ALTE DISCARDING NONE
1 GigabitEthernet0/0/3 ROOT FORWARDING NONE
2 GigabitEthernet0/0/3 ROOT FORWARDING NONE
[SwitchD] display stp interface gigabitethernet 0/0/2 brief
MSTID Port Role STP State Protection
0 GigabitEthernet0/0/2 ROOT FORWARDING NONE
1 GigabitEthernet0/0/2 ALTE DISCARDING NONE
2 GigabitEthernet0/0/2 DESI FORWARDING NONE
标签:
原文地址:http://www.cnblogs.com/zhuimengle/p/5906806.html