多生成树协议MSTP实验

1、概念

多生成树协议MSTP(Multiple Spanning Tree Protocol)是IEEE802.1s中定义的生成树协议,通过生成多个生成树,来解决以太网环路问题。

2、实验拓扑图

3、PC配置

4、交换机1配置

[SW1]vlan batch 100 200
Info: This operation may take a few seconds. Please wait for a moment...done.
[SW1]interface e0/0/10
[SW1-Ethernet0/0/10]port link-type trunk
[SW1-Ethernet0/0/10]port trunk allow-pass vlan 2 to 4094
[SW1-Ethernet0/0/10]interface e0/0/11
[SW1-Ethernet0/0/11]port link-type trunk
[SW1-Ethernet0/0/11]port trunk allow-pass vlan 2 to 4094
[SW1-Ethernet0/0/11]interface e0/0/12
[SW1-Ethernet0/0/12]port link-type trunk
[SW1-Ethernet0/0/12]port trunk allow-pass vlan 2 to 4094
[SW1-Ethernet0/0/12]
<SW1>save
The current configuration will be written to the device.
Are you sure to continue?[Y/N]y
Info: Please input the file name ( *.cfg, *.zip ) [vrpcfg.zip]:
Now saving the current configuration to the slot 0.
Save the configuration successfully.

5、交换机2配置

<SW2>sy
Enter system view, return user view with Ctrl+Z.
[SW2]interface e0/0/10
[SW2-Ethernet0/0/10]port link-type trunk
[SW2-Ethernet0/0/10]port trunk allow-pass vlan 2 to 4094
[SW2-Ethernet0/0/10]interface e0/0/11
[SW2-Ethernet0/0/11]port link-type trunk
[SW2-Ethernet0/0/11]port trunk allow-pass vlan 2 to 4094
[SW2-Ethernet0/0/11]interface e0/0/12
[SW2-Ethernet0/0/12]port link-type trunk
[SW2-Ethernet0/0/12]port trunk allow-pass vlan 2 to 4094
[SW2-Ethernet0/0/12]
<SW2>save
The current configuration will be written to the device.
Are you sure to continue?[Y/N]y
Info: Please input the file name ( *.cfg, *.zip ) [vrpcfg.zip]:
Now saving the current configuration to the slot 0.
Save the configuration successfully.
<SW2>

6、交换机3配置

<Huawei>sy
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname SW3
[SW3]vlan batch 100 200
Info: This operation may take a few seconds. Please wait for a moment...done.
[SW3]interface e0/0/1
[SW3-Ethernet0/0/1]port link-type access
[SW3-Ethernet0/0/1]port default vlan 100
[SW3-Ethernet0/0/1]interface e0/0/2
[SW3-Ethernet0/0/2]port link-type access
[SW3-Ethernet0/0/2]port default vlan 200
[SW3-Ethernet0/0/2]interface e0/0/11
[SW3-Ethernet0/0/11]port link-type trunk
[SW3-Ethernet0/0/11]port trunk allow-pass vlan 2 to 4094
[SW3-Ethernet0/0/11]interface e0/0/12
[SW3-Ethernet0/0/12]port link-type trunk
[SW3-Ethernet0/0/12]port trunk allow-pass vlan 2 to 4094
[SW3-Ethernet0/0/12]
<SW3>save

7、交换机4配置

<Huawei>sy
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname SW4
[SW4]vlan batch 100 200
Info: This operation may take a few seconds. Please wait for a moment...done.
[SW4]interface e0/0/3
[SW4-Ethernet0/0/3]port link-type access
[SW4-Ethernet0/0/3]port default vlan 100
[SW4-Ethernet0/0/3]interface e0/0/4
[SW4-Ethernet0/0/4]port link-type access
[SW4-Ethernet0/0/4]port default vlan 200
[SW4-Ethernet0/0/4]interface e0/0/11
[SW4-Ethernet0/0/11]port link-type trunk
[SW4-Ethernet0/0/11]port trunk allow-pass vlan 2 to 4094
[SW4-Ethernet0/0/11]interface e0/0/12
[SW4-Ethernet0/0/12]port link-type trunk
[SW4-Ethernet0/0/12]port trunk allow-pass vlan 2 to 4094
[SW4-Ethernet0/0/12]
<SW4>save

8、配置MSTP,新拓扑不用配置(默认为MSTP)

(1)进入MSTP视图

[SW3]stp region-configuration
[SW3-mst-region]

(2)创建域名和版本以及实例的VLAN关联

  • 交换机3:
[SW3-mst-region]region-name huawei
[SW3-mst-region]revision-level 1
[SW3-mst-region]instance 1 vlan 100
[SW3-mst-region]instance 2 vlan 200
[SW3-mst-region]active region-configuration
  • 交换机4:
[SW4]stp region-configuration
[SW4-mst-region]region-name huawei
[SW4-mst-region]revision-level 1
[SW4-mst-region]instance 1 vlan 100
[SW4-mst-region]instance 2 vlan 200
[SW4-mst-region]active region-configuration
  • 交换机1:
[SW1]stp region-configuration
[SW1-mst-region]region-name huawei
[SW1-mst-region]region-name huawei
[SW1-mst-region]revision-level 1
[SW1-mst-region]instance 1 vlan 100
[SW1-mst-region]instance 2 vlan 200
[SW1-mst-region]active region-configuration
  • 交换机2:
[SW2]stp region-configuration
[SW2-mst-region]region-name huawei
[SW2-mst-region]revision-level 1
[SW2-mst-region]instance 1 vlan 100
[SW2-mst-region]instance 2 vlan 200
[SW2-mst-region]active region-configuration

(3)查看MSTP相关信息

  • 交换机1:
[SW1]dis stp region-configuration
 Oper configuration
   Format selector    :0             
   Region name        :huawei             
   Revision level     :1

   Instance   VLANs Mapped
      0       1 to 99, 101 to 199, 201 to 4094
      1       100
      2       200
[SW1]

(4)在交换机1中配置实例1为主根,实例2为备份根,在交互机2上配置实例2位主根,实例1为备份根。

  • 交换机1:
[SW1]stp instance 1 root primary
[SW1]stp instance 2 root secondary
  • 交换机2:
[SW2]stp instance 2 root primary
[SW2]stp instance 1 root secondary

9、测试连通性

猜你喜欢

转载自blog.csdn.net/fanjufei123456/article/details/106249529