交换机sw1: [sw1]vlan batch 10 20 (创建多个vlan) [sw1]int e0/0/1 (进入端口) [sw1-Ethernet0/0/1]port link-type access(配置端口access模式) [sw1-Ethernet0/0/1]port default vlan 10 (加入vlan10) [sw1-Ethernet0/0/1]int e0/0/2 (进入第二个端口) [sw1-Ethernet0/0/2]port link-type access (配置端口access模式) [sw1-Ethernet0/0/2]port default vlan 20 (加入vlan20)

[sw1]port-group 1 (创建组) [sw1-port-group-1]group-member e0/0/3 e0/0/4 (把e/0/0/3,e0/0/4加入组) [sw1-port-group-1]port link-type trunk (配置端口trunk模式) [sw1-port-group-1]port trunk allow-pass vlan all (允许所有vlan带标签通过)

[sw1]stp region-configuration (进入stp域的配置) [sw1-mst-region]region-name+(名字) {设置名字,名字必须和其他的交换机设置的是一样,也必须要设置名字} [sw1-mst-region]instance 1 vlan 10 (指定实例中的vlan) [sw1-mst-region]instance 2 vlan 20 (指定实例中的vlan) [sw1-mst-region]active region-configuration (激活stp域)

交换机sw2为vlan10的跟网桥,vlan20的次网桥: [sw2]vlan batch 10 20 [sw2]int e0/0/1 [sw2-Ethernet0/0/1]port link-type access [sw2-Ethernet0/0/1]port default vlan 10 [sw2-Ethernet0/0/1]int e0/0/2 [sw2-Ethernet0/0/2]port link-type access [sw2-Ethernet0/0/2]port default vlan 20

[sw2]port-group 1 [sw2-port-group-1]group-member e0/0/3 e0/0/4 [sw2-port-group-1]port link-type trunk [sw2-port-group-1]port trunk allow-pass vlan all

[sw2]stp region-configuration [sw2-mst-region]region-name+(名字) [sw2-mst-region]instance 1 vlan 10 (实例1) [sw2-mst-region]instance 2 vlan 20 (实例2) [sw2-mst-region]active region-configuration

[sw2]stp instance 1 priority 4096 (配置实例1为跟网桥) [sw2]stp instance 2 priority 8192 (配置实例2为次网桥)

交换机sw3为vlan20跟网桥,vlan10为次网桥: [sw3]vlan batch 10 20 [sw3]int e0/0/1 [sw3-Ethernet0/0/1]port link-type access [sw3-Ethernet0/0/1]port default vlan 10 [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]port-group 1 [sw3-port-group-1]group-member e0/0/3 e0/0/4 [sw3-port-group-1]port link-type trunk [sw3-port-group-1]port trunk allow-pass vlan all

[sw3]stp region-configuration [sw3-mst-region]region-name+(名字) [sw3-mst-region]instance 1 vlan 10 (实例1) [sw3-mst-region]instance 2 vlan 20 (实例2) [sw3-mst-region]active region-configuration

[sw3]stp instance 2 priority 4096 (配置实例2为跟网桥) [sw3]stp instance 1 priority 8192 (配置实例1为次网桥)

总结= 配置好了可以用抓包软件,抓包看一下ping的数据向哪边走向。