341、多生成树协议:(华为的交换机默认运行MSTP)
工作原理:将多个vlan绑定在一起,运行在同一个stp实例里面,不同的实例之间的stp是互相独立的
tips:默认的的情况下,所有的vlan都在实例0里面;
342、实验topo:
实验需求:
配置MSTP,实现无论哪个vlan的PC通信都可以走最短路径;
实验步骤:
分别按照topo,将交换机的各个接口划分至vlan 10 、vlan 20 中;
SW1:
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 2 to 4094
#
interface GigabitEthernet0/0/2
port link-type trunk
port trunk allow-pass vlan 2 to 4094
#
interface GigabitEthernet0/0/3
port link-type access
port default vlan 10
#
SW2:
#
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 2 to 4094
#
interface GigabitEthernet0/0/2
port link-type trunk
port trunk allow-pass vlan 2 to 4094
#
interface GigabitEthernet0/0/3
port link-type access
port default vlan 20
#
interface GigabitEthernet0/0/4
port link-type access
port default vlan 20
#
SW3:
#
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 2 to 4094
#
interface GigabitEthernet0/0/2
port link-type trunk
port trunk allow-pass vlan 2 to 4094
#
interface GigabitEthernet0/0/3
port link-type access
port default vlan 20
#
配置MSTP:
instance 1:vlan 10
instance 2:vlan 20
划分实例:
stp region-configuration
SW1:
#
stp region-configuration
instance 1 vlan 10
instance 2 vlan 20
active region-configuration
#
SW2:
#
stp region-configuration
instance 1 vlan 10
instance 2 vlan 20
active region-configuration
#
SW3:
#
stp region-configuration
instance 1 vlan 10
instance 2 vlan 20
active region-configuration
#
比较优先级,查找出根桥;
由于SW1 G0/0/2端口阻塞,因此,需要将实例1 的SW1的优先级调低也就是针对实例1 ,阻塞端口为G0/0/2,针对实例2 ,阻塞G0/0/1
tips:此时的SW3 的优先级高于SW1的优先级,所以会将
#
stp instance 1 priority 4096 将阻塞口的针对实例1 的stp 优先级调小;
#
查看STP接口信息: