实验拓扑
实验步骤:
[ws1]display stp //查看MAC地址优先级
确认根网桥
ws1]display stp brief //查看端口状态
确认根端口、DESI 指定端口、ROOT 堵塞端口 ALTE
[ws1]vlan batch 10 20 30 //创建vlan
[ws1]interface Ethernet 0/0/5 //配置接口
[ws1-Ethernet0/0/5]port link-type trunk //改为trunk链路
[ws1-Ethernet0/0/5]port trunk allow-pass vlan all //将vlan加入trunk链路
[ws1]interface Ethernet 0/0/6
[ws1-Ethernet0/0/6]port link-type trunk
[ws1-Ethernet0/0/6]port trunk allow-pass vlan all
[ws2]vlan batch 10 20 30
[ws2]interface Ethernet 0/0/5
[ws2-Ethernet0/0/5]port link-type trunk
[ws2-Ethernet0/0/5]port trunk allow-pass vlan all
[ws3]interface Ethernet 0/0/6
[ws3-Ethernet0/0/6]port link-type trunk
[ws3-Ethernet0/0/6]port trunk allow-pass vlan all
[ws3]vlan batch 10 20 30
[ws3]interface Ethernet 0/0/5
[ws3-Ethernet0/0/5]port link-type trunk
[ws3-Ethernet0/0/5]port trunk allow-pass vlan all
[ws3]interface Ethernet 0/0/6
[ws3-Ethernet0/0/6]port link-type trunk
[ws3-Ethernet0/0/6]port trunk allow-pass vlan all
[ws1]interface Ethernet0/0/2 //配置接口
[ws1-Ethernet0/0/2]port link-type access //修改为Access
[ws1-Ethernet0/0/2]port default vlan 10 //将vlan加入Access链路
[ws1]interface Ethernet0/0/3
[ws1-Ethernet0/0/3]port link-type access
[ws1-Ethernet0/0/3]port default vlan 10
[ws1]interface Vlanif 10 //配置vlanif接口
[ws1-Vlanif10]ip address 192.168.10.254 //配置IP
[ws1-Vlanif10]undo shutdown //开启
[ws1]interface Vlanif 20
[ws1-Vlanif20]ip address 192.168.20.254
[ws1-Vlanif20]undo shutdown
[ws1]interface Vlanif 30
[ws1-Vlanif30]ip address 192.168.30.254
[ws1-Vlanif30]undo shutdown
[ws2]interface Ethernet0/0/2
[ws2-Ethernet0/0/2]port link-type access
[ws2-Ethernet0/0/2]port default vlan 20
[ws2]interface Ethernet0/0/3
[ws2-Ethernet0/0/3]port link-type access
[ws2-Ethernet0/0/3]port default vlan 20
[ws3]interface Ethernet0/0/2
[ws3-Ethernet0/0/2]port link-type access
[ws3-Ethernet0/0/2]port default vlan 30
[ws3]interface Ethernet0/0/3
[ws3-Ethernet0/0/3]port link-type access
[ws3-Ethernet0/0/3]port default vlan 30
MSTP 多实例生成树协议实现 链路冗余备份 负载均衡
[ws1]stp region-configuration //创建域配置
[ws1-mst-region]region-name ntd1807 //配置域的名字
[ws1-mst-region]instance 1 vlan 10 //VIAN10与实例1绑定
[ws1-mst-region]instance 2 vlan 20
[ws1-mst-region]instance 3 vlan 30
[ws1-mst-region]active region-configuration //激活与配置
[ws2]stp region-configuration
[ws2-mst-region]region-name ntd1807
[ws2-mst-region]instance 1 vlan 10
[ws2-mst-region]instance 2 vlan 20
[ws2-mst-region]instance 3 vlan 30
[ws2-mst-region]active region-configuration
[ws3]stp region-configuration
[ws3-mst-region]region-name ntd1807
[ws3-mst-region]instance 1 vlan 10
[ws3-mst-region]instance 2 vlan 20
[ws3-mst-region]instance 3 vlan 30
[ws3-mst-region]active region-configuration
[ws1]stp instance 1 priority 4096 //实例1作为备根
[ws1]stp instance 2 priority 8192 //实例2作为备根
[ws1]stp instance 3 priority 16384 //实例3作为主根
[ws2]stp instance 3 priority 4096 //实例3作为备根
[ws2]stp instance 2 priority 8192 //实例2作为备根
[ws2]stp instance 1 priority 16384 //实例1作为主根
[ws3]stp instance 1 priority 4096 //实例1作为备根
[ws3]stp instance 3 priority 8192 //实例3作为备根
[ws3]stp instance 2 priority 16384 //实例2作为主根
实验结果
通过STP生成树协议 防止二层交换意外的发生 而互通
配置 MSTP 多实例生成树协议实现 链路冗余备份 负载均衡