实验topo:
当组网成功时:
SW1:
vlan batch 10 20 30 40
stp mode mstp
stp enable
stp region-configuration
region-name huawei
instance 1 vlan 10 20
instance 2 vlan 30 40 active region-configuration
stp instance 1 root primary
stp instance 2 root secondary
interface GigabitEthernet0/0/24
port link-type trunk
port trunk allow-pass all interface GigabitEthernet0/0/21 port link-type trunk
port trunk allow-pass all
interface Vlanif10
ip address 192.168.10.253 255.255.255.0
vrrp vrid 10 virtual-ip 192.168.10.254
vrrp vrid 10 priority 120
vrrp vrid 10 preempt-mode timer delay 20
interface Vlanif20
ip address 192.168.20.253 255.255.255.0
vrrp vrid 20 virtual-ip 192.168.20.254
vrrp vrid 20 priority 120
vrrp vrid 20 preempt-mode timer delay 20
interface Vlanif30
ip address 192.168.30.252 255.255.255.0
vrrp vrid 30 virtual-ip 192.168.30.254
interface Vlanif40
ip address 192.168.40.252 255.255.255.0
vrrp vrid 40 virtual-ip 192.168.40.254
SW2
vlan batch 10 20 30 40
stp mode mstp
stp enable
stp region-configuration
region-name huawei
instance 1 vlan 10 20
instance 2 vlan 30 40 active region-configuration
stp instance 2 root primary
stp instance 1 root secondary
interface GigabitEthernet0/0/24
port link-type trunk
port trunk allow-pass all interface GigabitEthernet0/0/22 port link-type trunk
port trunk allow-pass all
interface Vlanif10
ip address 192.168.10.252 255.255.255.0
vrrp vrid 10 virtual-ip 192.168.10.254
interface Vlanif20
ip address 192.168.20.252 255.255.255.0
vrrp vrid 20 virtual-ip 192.168.20.254
interface Vlanif30
ip address 192.168.30.253 255.255.255.0
vrrp vrid 30 virtual-ip 192.168.30.254
vrrp vrid 30 priority 120
vrrp vrid 30 preempt-mode timer delay 20
interface Vlanif40
ip address 192.168.40.253 255.255.255.0
vrrp vrid 40 virtual-ip 192.168.40.254
vrrp vrid 40 priority 120
vrrp vrid 40 preempt-mode timer delay 20
SW3