TypechoJoeTheme

主机评测

主机评测

专注云主机评测和优惠码发布

MSTP_

2022-03-27
/
0 评论
/
1,363 阅读
/
正在检测是否收录...
03/27

4 配置举例

4.1 组网需求

如图所示,当前网络中SwitchA、SwitchB、SwitchC和SwitchD通过环形组网备份链路,同时对两个用户的流量进行负载分担。希望通过运行MSTP协议阻塞特定端口,将环形网络结构修剪成无环路的树形网络结构。

? 部门1和部门2的流量进行负载分担。

? SwitchA和SwitchB分别作为两个部门的根桥和备份根桥。

? SwitchC和SwitchD连接用户的接口GE1/0/3不要参与STP计算。

4.2 配置思路

采用如下的思路配置MSTP:

  1. 创建VLAN,并把接口加入VLAN。
  2. 配置模式是MSTP模式。
  3. 配置域名为RG1,并配置域内VLAN和实例的映射关系。
  4. 配置SwitchA和SwitchB分别作为两个部门的根桥和备份根桥。
  5. 统一使用默认路径开销。华为交换机默认的路径开销计算标准使用的是标准的dot1t。GE接口默认路径开销是20000,而Ethernet接口默认路径开销是200000。注意:eNSP模拟器中,STP的路径开销默认是1。
  6. SwitchC和SwitchD的GE1/0/3端口去使能STP协议。
  7. SwitchA、SwitchB、SwitchC和SwitchD使能STP协议。

4.3 操作步骤

步骤1:创建VLAN,并把接口加入VLAN。

<HUAWEI> system-view

[HUAWEI] sysname SwitchA

[SwitchA] vlan batch 2 to 4094

[SwitchA] interface gigabitethernet0/0/1

[SwitchA-GigabitEthernet0/0/1] port link-type trunk

[SwitchA-GigabitEthernet0/0/1] port trunk allow-pass vlan 2 to 4094

[SwitchA-GigabitEthernet0/0/1] quit

[SwitchA] interface gigabitethernet0/0/2

[SwitchA-GigabitEthernet0/0/2] port link-type trunk

[SwitchA-GigabitEthernet0/0/2] port trunk allow-pass vlan 2 to 4094

[SwitchA-GigabitEthernet0/0/2] quit

<HUAWEI> system-view

[HUAWEI] sysname SwitchB

[SwitchB] vlan batch 2 to 4094

[SwitchB] interface gigabitethernet0/0/1

[SwitchB-GigabitEthernet0/0/1] port link-type trunk

[SwitchB-GigabitEthernet0/0/1] port trunk allow-pass vlan 2 to 4094

[SwitchB-GigabitEthernet0/0/1] quit

[SwitchB] interface gigabitethernet0/0/2

[SwitchB-GigabitEthernet0/0/2] port link-type trunk

[SwitchB-GigabitEthernet0/0/2] port trunk allow-pass vlan 2 to 4094

[SwitchB-GigabitEthernet0/0/2] quit

<HUAWEI> system-view

[HUAWEI] sysname SwitchC

[SwitchC] vlan batch 2 to 4094

[SwitchC] interface gigabitethernet0/0/1

[SwitchC-GigabitEthernet0/0/1] port link-type trunk

[SwitchC-GigabitEthernet0/0/1] port trunk allow-pass vlan 2 to 4094

[SwitchC-GigabitEthernet0/0/1] quit

[SwitchC] interface gigabitethernet0/0/2

[SwitchC-GigabitEthernet0/0/2] port link-type trunk

[SwitchC-GigabitEthernet0/0/2] port trunk allow-pass vlan 2 to 4094

[SwitchC-GigabitEthernet0/0/2] quit

<HUAWEI> system-view

[HUAWEI] sysname SwitchD

[SwitchD] vlan batch 2 to 4094

[SwitchD] interface gigabitethernet0/0/1

[SwitchD-GigabitEthernet0/0/1] port link-type trunk

[SwitchD-GigabitEthernet0/0/1] port trunk allow-pass vlan 2 to 4094

[SwitchD-GigabitEthernet0/0/1] quit

[SwitchD] interface gigabitethernet0/0/2

[SwitchD-GigabitEthernet0/0/2] port link-type trunk

[SwitchD-GigabitEthernet0/0/2] port trunk allow-pass vlan 2 to 4094

[SwitchD-GigabitEthernet0/0/2] quit

步骤2:配置模式为MSTP模式。

华为交换机默认是MSTP模式,该步骤可以省略。

[SwitchA] stp mode mstp

[SwitchB] stp mode mstp

[SwitchC] stp mode mstp

[SwitchD] stp mode mstp

步骤3:配置域名为RG1,并配置域内VLAN和实例的映射关系。

注意4台设备的域配置需要完全一致,才可以正确破环。

[SwitchA] stp region-configuration

[SwitchA-mst-region] region-name RG1 //配置域名为RG1

[SwitchA-mst-region] instance 1 vlan 1 to 200 //默认所有VLAN都属于实例0,这里把VLAN1~200映射为实例1,其他VLAN201~4094还是属于实例0

[SwitchA-mst-region] active region-configuration //域内的配置,需要激活才能生效

[SwitchA-mst-region] quit

[SwitchB] stp region-configuration

[SwitchB-mst-region] region-name RG1

[SwitchB-mst-region] instance 1 vlan 1 to 200

[SwitchB-mst-region] active region-configuration

[SwitchB-mst-region] quit

[SwitchC] stp region-configuration

[SwitchC-mst-region] region-name RG1

[SwitchC-mst-region] instance 1 vlan 1 to 200

[SwitchC-mst-region] active region-configuration

[SwitchC-mst-region] quit

[SwitchD] stp region-configuration

[SwitchD-mst-region] region-name RG1

[SwitchD-mst-region] instance 1 vlan 1 to 200

[SwitchD-mst-region] active region-configuration

[SwitchD-mst-region] quit

步骤4:配置根桥和备份根桥。

配置在实例0中SwitchA为根桥,SwitchB为备份根桥。在实例1中SwitchA为备份根桥,SwitchB为根桥。

[SwitchA] stp instance 0 root primary //也可以使用命令stp priority 0 配置优先级为0,和stp root primary的作用是一样的。

[SwitchA] stp instance 1 root secondary //也可以使用命令stp priority 4096 配置优先级为4096,和stp root secondary的作用是一样的。

[SwitchB] stp instance 0 root secondary

[SwitchB] stp instance 1 root primary

步骤5:去使能SwitchB和SwitchC设备GE0/0/3端口的STP功能。

[SwitchC] interface gigabitethernet0/0/3

[SwitchC-GigabitEthernet0/0/3] stp disable

[SwitchC-GigabitEthernet0/0/3] quit

[SwitchD] interface gigabitethernet 0/0/3

[SwitchD-GigabitEthernet0/0/3] stp disable

[SwitchD-GigabitEthernet0/0/3] quit

步骤6:全局使能STP功能。

华为X7系列交换机默认是使能,该步骤可以省略。

[SwitchA] stp enable

[SwitchB] stp enable

[SwitchC] stp enable

[SwitchD] stp enable

步骤7:验证配置结果

查看MSTP简要信息,通过MSTP简要信息可以快速的看出端口的角色和状态。

4.4 配置文件

SwitchA的配置文件

  1. #
  2. sysname SwitchA
  3. #
  4. vlan batch 2 to 4094
  5. #
  6. stp instance 0 root primary
  7. stp instance 1 root secondary
  8. stp enable
  9. #
  10. stp region-configuration
  11. region-name RG1
  12. instance 1 vlan 1 to 200
  13. active region-configuration
  14. #
  15. interface GigabitEthernet0/0/1
  16. port link-type trunk
  17. port trunk allow-pass vlan 2 to 4094
  18. #
  19. interface GigabitEthernet0/0/2
  20. port link-type trunk
  21. port trunk allow-pass vlan 2 to 4094
  22. #
  23. return

SwitchB的配置文件

  1. #
  2. sysname SwitchB
  3. #
  4. vlan batch 2 to 4094
  5. #
  6. stp instance 0 root secondary
  7. stp instance 1 root primary
  8. stp enable
  9. #
  10. stp region-configuration
  11. region-name RG1
  12. instance 1 vlan 1 to 200
  13. active region-configuration
  14. #
  15. interface GigabitEthernet0/0/1
  16. port link-type trunk
  17. port trunk allow-pass vlan 2 to 4094
  18. #
  19. interface GigabitEthernet0/0/2
  20. port link-type trunk
  21. port trunk allow-pass vlan 2 to 4094
  22. #
  23. return

SwitchC的配置文件

  1. #
  2. sysname SwitchC
  3. #
  4. vlan batch 2 to 4094
  5. #
  6. stp enable
  7. #
  8. stp region-configuration
  9. region-name RG1
  10. instance 1 vlan 1 to 200
  11. active region-configuration
  12. #
  13. interface GigabitEthernet0/0/1
  14. port link-type trunk
  15. port trunk allow-pass vlan 2 to 4094
  16. #
  17. interface GigabitEthernet0/0/2
  18. port link-type trunk
  19. port trunk allow-pass vlan 2 to 4094
  20. #
  21. interface GigabitEthernet0/0/3
  22. stp disable
  23. #
  24. return

SwitchD的配置文件

  1. #
  2. sysname SwitchD
  3. #
  4. vlan batch 2 to 4094
  5. #
  6. stp mode stp
  7. #
  8. interface GigabitEthernet0/0/1
  9. port link-type trunk
  10. port trunk allow-pass vlan 2 to 4094
  11. #
  12. interface GigabitEthernet0/0/2
  13. port link-type trunk
  14. port trunk allow-pass vlan 2 to 4094
  15. #
  16. interface GigabitEthernet0/0/3
  17. stp disable
  18. #
  19. return

https://www.zjpc.cc/images/1519615890999465.png

MSTP
朗读

赞 · 0
赞赏
感谢您的支持,我会继续努力哒!
打开手机扫一扫,即可进行打赏哦!
版权属于:

主机评测

本文链接:

https://www.zjpc.cc/1103.html(转载时请注明本文出处及文章链接)

评论 (0)
  • OωO
  • |´・ω・)ノ
  • ヾ(≧∇≦*)ゝ
  • (☆ω☆)
  • (╯‵□′)╯︵┴─┴
  •  ̄﹃ ̄
  • (/ω\)
  • ∠( ᐛ 」∠)_
  • (๑•̀ㅁ•́ฅ)
  • →_→
  • ୧(๑•̀⌄•́๑)૭
  • ٩(ˊᗜˋ*)و
  • (ノ°ο°)ノ
  • (´இ皿இ`)
  • ⌇●﹏●⌇
  • (ฅ´ω`ฅ)
  • (╯°A°)╯︵○○○
  • φ( ̄∇ ̄o)
  • ヾ(´・ ・`。)ノ"
  • ( ง ᵒ̌皿ᵒ̌)ง⁼³₌₃
  • (ó﹏ò。)
  • Σ(っ °Д °;)っ
  • ( ,,´・ω・)ノ"(´っω・`。)
  • ╮(╯▽╰)╭
  • o(*////▽////*)q
  • >﹏<
  • ( ๑´•ω•) "(ㆆᴗㆆ)
  • (。•ˇ‸ˇ•。)
  • 泡泡
  • 阿鲁
  • 颜文字
火爆
火爆
火爆