构建上图所示网络拓扑
目标:配置vlan,并将SW1配置为vlan10的主根桥,vlan20的备份根桥;LSW2配置为vlan10的备份根桥,vlan20 的主根桥,实现负载均衡
以SW3为例,配置vlan
[SW3]vlan batch 10 20 创建vlan
[SW3]int e0/0/1 进入需要配置的端口
[SW3-Ethernet0/0/1]port link-type access 配置连接类型,PC为access
[SW3-Ethernet0/0/1]port default vlan 10 将PC1划分到vlan10
[SW3-Ethernet0/0/1]int e0/0/2
[SW3-Ethernet0/0/2]port link-type access
[SW3-Ethernet0/0/2]port default vlan 20
[SW3-Ethernet0/0/2]int e0/0/3
[SW3-Ethernet0/0/3]port link-type trunk 配置连接类型,交换机之间为trunk
[SW3-Ethernet0/0/3]port trunk allow-pass vlan 10 20 设置允许vlan10和20通过
[SW3-Ethernet0/0/3]int e0/0/4
[SW3-Ethernet0/0/4]port link-type trunk
[SW3-Ethernet0/0/4]port trunk allow-pass vlan 10 20
对SW1、SW2和SW3进行配置
[SW1]stp region-configuration 进入域配置
[SW1-mst-region]region-name A 设置域名称为A(随意)
[SW1-mst-region]revision-level 1 设置协议版本为1(0-65535随意)
[SW1-mst-region]instance 1 vlan 10 设置vlan10属于实例1
[SW1-mst-region]instance 2 vlan 20 设置vlan20属于实例2
[SW1-mst-region]active region-configuration 开启配置
对SW1和SW2分别设置
[SW1]stp instance 1 root primary 设置SW1为实例1的主根桥
[SW1]stp instance 2 root secondary 设置SW1为实例2的备用根桥
[SW2]stp instance 2 root primary
[SW2]stp instance 1 root secondary