多生成樹協議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、測試連通性

 

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章