拓扑如下图所示:
配置步骤:
1.在SW1、SW2、SW3上建好vlan 10、vlan20,然后在SW1的GE0/0/1,SW2的G0/0/2,SW1的G0/0/1和G0/0/2的接口模式设为TRUNK,SW1的e0/0/1和e0/0/2的接口模式为acces
2.在SW1和SW2之间进行链路绑定,并把绑定后的Ethrunk的接口模式设TRUNK Eth-Trunk 1
[SW2]interface Eth-Trunk 1
[SW2]interface g0/0/3
[SW2-GigabitEthernet0/0/3]eth-trunk 1
[SW2]interface Eth-Trunk 1
[SW2-Eth-Trunk1]port link-type trunk
[SW2-Eth-Trunk1]port trunk allow-pass vlan 10 20
3.开始配置MSTP
先在SW1,SW2,SW3配置如下命令:
stp region-configuration
region-name qgtest
revision-level 1
instance 1 vlan 10
instance 2 vlan 20
active region-configuration
然后,在SW1上配置:
stp instance 1 root primary
stp instance 2 root secondary
在SW2上配置:
stp instance 1 root secondary
stp instance 2 root primary
4.可以在SW3的e0/0/1和e0/0/2上开启边缘端口,避免主机接受到BPDU报文
stp edged-port enable