第一步:启用生成树、选择生成树的方式 stp enable stp mode mstp 第二步:对树的区域定义进行配置并激活 stp region-configuration region-name zone1 instance 1 vlan 10 instance 2 vlan 20 active region-configuration 第三步:确定每个instance的主次 sw1: stp instance 1 root primary stp instance 2 root secondary sw2: stp instance 2 root primary stp instance 1 root secondary 注意:配置完成后,需要使用display stp brief命令查看哪些端口是根端口、哪些为指定端口、哪些为阻塞端口、备份端口、预备端口 第四步:配置vrrp,注意需要与生成树保持一致,不然可能会产生次优路由 sw1: interface Vlanif10 ip address 192.168.10.1 255.255.255.0 vrrp vrid 10 virtual-ip 192.168.10.254 vrrp vrid 10 priority 200 interface Vlanif20 ip address 192.168.20.2 255.255.255.0 vrrp vrid 20 virtual-ip 192.168.20.254 sw2: interface Vlanif10 ip address 192.168.10.1 255.255.255.0 vrrp vrid 10 virtual-ip 192.168.10.254 interface Vlanif20 ip address 192.168.20.2 255.255.255.0 vrrp vrid 20 virtual-ip 192.168.20.254 vrrp vrid 20 priority 200