1.1 接口下命令
sw3(config-if)#spanning-tree cost 39 //修改接口cost值
sw3(config-if)#spanning-tree port-priority 128 //修改接口port-id优先级,默认就是128
1.2 全局配置
sw3(config)#spanning-tree vlan 100 priority 32768 //在VLAN100里面修改BPDU中的BID的优先级,默认就是32768
sw3(config)#spanning-tree vlan 100 max-age 20 //在VLAN100里面修改BPDU的最大老化时间,默认20秒
sw3(config)#spanning-tree vlan 100 hello-time 2 //在VLAN100里面修改BPDU的发送间隔时间,默认2秒
sw3(config)#spanning-tree vlan 100 forward-time 15 //在VLAN100里面修改STP的转发延迟时间,默认15秒
sw3(config)#spanning-tree vlan 100 root primary
#spanning-tree vlan 200 root secondary
SW3交换机是VLAN100的主根桥,VLAN200的备份根桥