如何配置MSTP及负载均衡,实验过程

问题

配置MSTP实现多生成树效果
配置A成为vlan 10 和 20 的主根,vlan 30 和 40 的次根
配置B成为vlan 30 和 40 的主根,vlan 10 和 20 的次根
查看配置信息

使用eNSP搭建实验环境:
如何配置MSTP及负载均衡,实验过程_第1张图片

步骤

实现此案例需要按照如下步骤进行。

[A]vlan batch 10 20 30 40
[A]int e0/0/2
[A-Ethernet0/0/2]port link-type trunk    
[A-Ethernet0/0/2]port trunk allow-pass vlan all
[A]int e0/0/3
[A-Ethernet0/0/3]port link-type trunk    
[A-Ethernet0/0/3]port trunk allow-pass vlan all

交换机B、C也同样配置。

[A]stp region-configuration 
[A-mst-region]region-name tedu
[A-mst-region]instance 1 vlan 10 20 
[A-mst-region]instance 2 vlan 30 40
[A-mst-region]active region-configuration

查看配置:

[A-mst-region]dis this
#
stp region-configuration
 region-name tedu
 instance 1 vlan 10 20
 instance 2 vlan 30 40
 active region-configuration
#
return

交换机B、C也同样配置。

3)配置主根与次根

[A]stp instance 1 priority 4096
[A]stp instance 2 priority 8192
[B]stp instance 2 priority 4096
[B]stp instance 1 priority 8192

4)验证

[A]dis stp instance 1
-------[MSTI 1 Global Info]-------
MSTI Bridge ID      :4096.4c1f-cc87-1de7
MSTI RegRoot/IRPC   :4096.4c1f-cc87-1de7 / 0
MSTI RootPortId     :0.0
Master Bridge       :32768.4c1f-cc0d-76bc
Cost to Master      :200000
TC received         :5
TC count per hello  :0
Time since last TC  :0 days 0h:3m:6s
Number of TC        :4
Last TC occurred    :Ethernet0/0/2
 ----[Port2(Ethernet0/0/2)][FORWARDING]----
 Port Role           :Designated Port
 Port Priority       :128
 Port Cost(Dot1T )   :Config=auto / Active=200000
 Designated Bridge/Port   :4096.4c1f-cc87-1de7 / 128.2
 Port Times          :RemHops 20
 TC or TCN send      :4
 TC or TCN received  :3
 ----[Port3(Ethernet0/0/3)][FORWARDING]----
 Port Role           :Designated Port
 Port Priority       :128
 Port Cost(Dot1T )   :Config=auto / Active=200000
 Designated Bridge/Port   :4096.4c1f-cc87-1de7 / 128.3
 Port Times          :RemHops 20
 TC or TCN send      :2
 TC or TCN received  :2
[A]dis stp instance 2
-------[MSTI 2 Global Info]-------
MSTI Bridge ID      :8192.4c1f-cc87-1de7
MSTI RegRoot/IRPC   :4096.4c1f-cc0d-76bc / 200000
MSTI RootPortId     :128.2
Master Bridge       :32768.4c1f-cc0d-76bc
Cost to Master      :200000
TC received         :4
TC count per hello  :0
Time since last TC  :0 days 0h:3m:49s
Number of TC        :4
Last TC occurred    :Ethernet0/0/2
 ----[Port2(Ethernet0/0/2)][FORWARDING]----
 Port Role           :Root Port
 Port Priority       :128
 Port Cost(Dot1T )   :Config=auto / Active=200000
 Designated Bridge/Port   :4096.4c1f-cc0d-76bc / 128.1
 Port Times          :RemHops 20
 TC or TCN send      :4
 TC or TCN received  :3
 ----[Port3(Ethernet0/0/3)][FORWARDING]----
 Port Role           :Designated Port
 Port Priority       :128
 Port Cost(Dot1T )   :Config=auto / Active=200000
 Designated Bridge/Port   :8192.4c1f-cc87-1de7 / 128.3
 Port Times          :RemHops 19
 TC or TCN send      :2
 TC or TCN received  :1
[B]dis stp instance 1
-------[MSTI 1 Global Info]-------
MSTI Bridge ID      :8192.4c1f-cc0d-76bc
MSTI RegRoot/IRPC   :4096.4c1f-cc87-1de7 / 200000
MSTI RootPortId     :128.1
Master Bridge       :32768.4c1f-cc0d-76bc
Cost to Master      :0
TC received         :4
TC count per hello  :0
Time since last TC  :0 days 0h:5m:26s
Number of TC        :4
Last TC occurred    :Ethernet0/0/3
 ----[Port1(Ethernet0/0/1)][FORWARDING]----
 Port Role           :Root Port
 Port Priority       :128
 Port Cost(Dot1T )   :Config=auto / Active=200000
 Designated Bridge/Port   :4096.4c1f-cc87-1de7 / 128.2
 Port Times          :RemHops 20
 TC or TCN send      :3
 TC or TCN received  :4
 ----[Port3(Ethernet0/0/3)][FORWARDING]----
 Port Role           :Designated Port
 Port Priority       :128
 Port Cost(Dot1T )   :Config=auto / Active=200000
 Designated Bridge/Port   :8192.4c1f-cc0d-76bc / 128.3
 Port Times          :RemHops 19
 TC or TCN send      :1
 TC or TCN received  :0
[B]dis stp instance 2
-------[MSTI 2 Global Info]-------
MSTI Bridge ID      :4096.4c1f-cc0d-76bc
MSTI RegRoot/IRPC   :4096.4c1f-cc0d-76bc / 0
MSTI RootPortId     :0.0
Master Bridge       :32768.4c1f-cc0d-76bc
Cost to Master      :0
TC received         :6
TC count per hello  :0
Time since last TC  :0 days 0h:6m:4s
Number of TC        :5
Last TC occurred    :Ethernet0/0/3
 ----[Port1(Ethernet0/0/1)][FORWARDING]----
 Port Role           :Designated Port
 Port Priority       :128
 Port Cost(Dot1T )   :Config=auto / Active=200000
 Designated Bridge/Port   :4096.4c1f-cc0d-76bc / 128.1
 Port Times          :RemHops 20
 TC or TCN send      :3
 TC or TCN received  :4
 ----[Port3(Ethernet0/0/3)][FORWARDING]----
 Port Role           :Designated Port
 Port Priority       :128
 Port Cost(Dot1T )   :Config=auto / Active=200000
 Designated Bridge/Port   :4096.4c1f-cc0d-76bc / 128.3
 Port Times          :RemHops 20
 TC or TCN send      :2
 TC or TCN received  :2
[C]dis stp instance 1
-------[MSTI 1 Global Info]-------
MSTI Bridge ID      :32768.4c1f-ccb8-32b8
MSTI RegRoot/IRPC   :4096.4c1f-cc87-1de7 / 200000
MSTI RootPortId     :128.1
Master Bridge       :32768.4c1f-cc0d-76bc
Cost to Master      :200000
TC received         :3
TC count per hello  :0
Time since last TC  :0 days 0h:6m:58s
Number of TC        :3
Last TC occurred    :Ethernet0/0/1
 ----[Port1(Ethernet0/0/1)][FORWARDING]----
 Port Role           :Root Port
 Port Priority       :128
 Port Cost(Dot1T )   :Config=auto / Active=200000
 Designated Bridge/Port   :4096.4c1f-cc87-1de7 / 128.3
 Port Times          :RemHops 20
 TC or TCN send      :2
 TC or TCN received  :2
 ----[Port2(Ethernet0/0/2)][DISCARDING]----
 Port Role           :Alternate Port
 Port Priority       :128
 Port Cost(Dot1T )   :Config=auto / Active=200000
 Designated Bridge/Port   :8192.4c1f-cc0d-76bc / 128.3
 Port Times          :RemHops 19
 TC or TCN send      :0
 TC or TCN received  :1
[C]dis stp instance 2
-------[MSTI 2 Global Info]-------
MSTI Bridge ID      :32768.4c1f-ccb8-32b8
MSTI RegRoot/IRPC   :4096.4c1f-cc0d-76bc / 200000
MSTI RootPortId     :128.2
Master Bridge       :32768.4c1f-cc0d-76bc
Cost to Master      :200000
TC received         :4
TC count per hello  :0
Time since last TC  :0 days 0h:7m:32s
Number of TC        :4
Last TC occurred    :Ethernet0/0/2
 ----[Port1(Ethernet0/0/1)][DISCARDING]----
 Port Role           :Alternate Port
 Port Priority       :128
 Port Cost(Dot1T )   :Config=auto / Active=200000
 Designated Bridge/Port   :8192.4c1f-cc87-1de7 / 128.3
 Port Times          :RemHops 19
 TC or TCN send      :1
 TC or TCN received  :2
 ----[Port2(Ethernet0/0/2)][FORWARDING]----
 Port Role           :Root Port
 Port Priority       :128
 Port Cost(Dot1T )   :Config=auto / Active=200000
 Designated Bridge/Port   :4096.4c1f-cc0d-76bc / 128.3
 Port Times          :RemHops 20
 TC or TCN send      :2
 TC or TCN received  :2

查看负载均衡:

[A]dis stp bri
 MSTID  Port                        Role  STP State     Protection
   0    Ethernet0/0/2               ROOT  FORWARDING      NONE
   0    Ethernet0/0/3               DESI  FORWARDING      NONE
   1    Ethernet0/0/2               DESI  FORWARDING      NONE
   1    Ethernet0/0/3               DESI  FORWARDING      NONE
   2    Ethernet0/0/2               ROOT  FORWARDING      NONE
   2    Ethernet0/0/3               DESI  FORWARDING      NONE
[B]dis stp bri
 MSTID  Port                        Role  STP State     Protection
   0    Ethernet0/0/1               DESI  FORWARDING      NONE
   0    Ethernet0/0/3               DESI  FORWARDING      NONE
   1    Ethernet0/0/1               ROOT  FORWARDING      NONE
   1    Ethernet0/0/3               DESI  FORWARDING      NONE
   2    Ethernet0/0/1               DESI  FORWARDING      NONE
   2    Ethernet0/0/3               DESI  FORWARDING      NONE
[C]dis stp bri
 MSTID  Port                        Role  STP State     Protection
   0    Ethernet0/0/1               ALTE  DISCARDING      NONE
   0    Ethernet0/0/2               ROOT  FORWARDING      NONE
   1    Ethernet0/0/1               ROOT  FORWARDING      NONE
   1    Ethernet0/0/2               ALTE  DISCARDING      NONE
   2    Ethernet0/0/1               ALTE  DISCARDING      NONE
   2    Ethernet0/0/2               ROOT  FORWARDING      NONE

C上VLAN 10 20的流量通过Ethernet0/0/1口到A,VLAN 30 40的流量通过Ethernet0/0/2口到B,实现了链路的负载均衡。

你可能感兴趣的:(华为网络杂谈)