组网拓扑如需下:交换机之间均使用Trunk口连接,交换机和PC之间使用Access口连接。LSW1配置:
设置STP 模式为MSTP,使能STP。
stp mode mstp
stp enable
配置设备的端口路径开销值的计算方法为 IEEE 802.1T
stp pathcost-standard dot1t
建立MSTP域,这里为MS,将VLAN 10映射为instance 1,将VLAN 20映射为instance 2,
stp region-configuration
region-name MS
instance 1 vlan 10
instance 2 vlan 20
active region-configuration
端口VLAN划分,关闭连接PC的端口STP,使不参与生成树路径计算。
interface GigabitEthernet0/0/1
port link-type access
port default vlan 10
stp disable
#
interface GigabitEthernet0/0/2
port link-type trunk
port trunk allow-pass vlan 20
#
interface GigabitEthernet0/0/3
port link-type trunk
port trunk allow-pass vlan 10 20
#
interface GigabitEthernet0/0/4
port link-type trunk
port trunk allow