MSTP

317 阅读4分钟
  • stp只能实现不同VLAN阻塞相同端口,不能实现VLAN分流;

概述

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

作用

  • 形成多棵无环路的树,解决广播风暴并实现冗余备份。
  • 多棵生成树在VLAN间实现负载均衡,不同VLAN的流量按照不同的路径转发。

实现

  • 将不同的VLAN流量添加到不同编号的生成树中,形成多生成数环境,不同生成树可以阻塞不同端口,从而达到VLAN分流效果;

命令

  • 进入STP配置域
    stp region-configuration
  • 设置域名称
    region-name 名称
  • 创建实例(实例编号取值范围:0~48),确定是承载的VLAN编号
    instance 实例编号 vlan VLAN编号
  • 应用配置(S5700需要执行该命令,CE交换机直接执行commit)
    active region-configuration
  • 设置根网桥
    stp instance 编号 root primary
  • 查看指定实例信息
    dis stp instance 编号
  • 开启STP功能(CE交换机)
    stp enable
  • 设置STP模式为MSTP(CE交换机)
    stp mode mstp

image.png LSW1:

  1. sys
  2. vlan batch 10 20
  3. int g0/0/1
  4. p l t
  5. p t a v 10 20
  6. int g0/0/2
  7. p l t
  8. p t a v 10 20
  9. q
  10. stp region-configuration
  11. region-name M1
  12. instance 1 vlan 10
  13. instance 2 vlan 20
  14. active region-configuration
  15. q
  16. stp instance 1 root primary

LSW2:

  1. sys
  2. vlan batch 10 20
  3. int g0/0/2
  4. p l t
  5. p t a v 10 20
  6. int g0/0/1
  7. p l t
  8. p t a v 10 20
  9. q
  10. stp region-configuration
  11. region-name M1
  12. instance 1 vlan 10
  13. instance 2 vlan 20
  14. active region-configuration
  15. q
  16. stp instance 2 root primary

LSW3:

  1. sys
  2. vlan batch 10 20
  3. int g0/0/1
  4. p l t
  5. p t a v 10 20
  6. int g0/0/2
  7. p l t
  8. p t a v 10 20
  9. int g0/0/3
  10. p l a
  11. p d v 10
  12. int g0/0/4
  13. p l a
  14. p d v 20
  15. q
  16. stp region-configuration
  17. region-name M1
  18. instance 1 vlan 10
  19. instance 2 vlan 20
  20. active region-configuration

LSW4:

  1. sys
  2. vlan batch 10 20
  3. int g0/0/1
  4. p l t
  5. p t a v 10 20
  6. int g0/0/2
  7. p l t
  8. p t a v 10 20
  9. int g0/0/3
  10. p l a
  11. p d v 10
  12. int g0/0/4
  13. p l a
  14. p d v 20
  15. q
  16. stp region-configuration
  17. region-name M1
  18. instance 1 vlan 10
  19. instance 2 vlan 20
  20. active region-configuration

CE案例

image.png

CE1:

  1. sys
  2. vlan batch 10 20
  3. commit
  4. int g1/0/0
  5. undo shutdown
  6. commit
  7. p l t
  8. p t a v 10 20
  9. commit
  10. int g1/0/1
  11. undo shutdown
  12. commit
  13. p l t
  14. p t a v 10 20
  15. commit
  16. q
  17. stp enable
  18. y
  19. commit
  20. stp mode mstp
  21. commit
  22. stp region-configuration
  23. region-name M1
  24. instance 1 vlan 10
  25. instance 2 vlan 20
  26. commit
  27. q
  28. stp instance 1 root primary
  29. commit

CE2:

  1. sys
  2. vlan batch 10 20
  3. commit
  4. int g1/0/0
  5. undo shutdown
  6. commit
  7. p l t
  8. p t a v 10 20
  9. commit
  10. int g1/0/1
  11. undo shutdown
  12. commit
  13. p l t
  14. p t a v 10 20
  15. commit
  16. q
  17. stp enable
  18. y
  19. commit
  20. stp mode mstp
  21. commit
  22. stp region-configuration
  23. region-name M1
  24. instance 1 vlan 10
  25. instance 2 vlan 20
  26. commit
  27. q
  28. stp instance 2 root primary
  29. commit

LSW3:

  1. sys
  2. vlan batch 10 20
  3. int g0/0/1
  4. p l t
  5. p t a v 10 20
  6. int g0/0/2
  7. p l t
  8. p t a v 10 20
  9. int g0/0/3
  10. p l a
  11. p d v 10
  12. int g0/0/4
  13. p l a
  14. p d v 20
  15. q
  16. stp region-configuration
  17. region-name M1
  18. instance 1 vlan 10
  19. instance 2 vlan 20
  20. active region-configuration

LSW4:

  1. sys
  2. vlan batch 10 20
  3. int g0/0/1
  4. p l t
  5. p t a v 10 20
  6. int g0/0/2
  7. p l t
  8. p t a v 10 20
  9. int g0/0/3
  10. p l a
  11. p d v 10
  12. int g0/0/4
  13. p l a
  14. p d v 20
  15. q
  16. stp region-configuration
  17. region-name M1
  18. instance 1 vlan 10
  19. instance 2 vlan 20
  20. active region-configuration