对各个接口做好配置后

我们首先对vrrp开始做配置

int vlan10

ip add 192.168.10.254 255.255.255.0

vrrp 10 ip 192.168.10.1 创建虚拟ip

vrrp 10 priority 160 等级最高最先

vvrp 10  preempt  允许抢占

vvrp10 track fast 0/1 20 端口down 这个vvrp立刻下降20 priority

int vlan20

ip add 192.168.20.254 255.255.255.0

vrrp 20 ip 192.168.20.1

vrrp 20 priority 150

vvrp 20  preempt

vvrp 20 track fast 0/1 20

 

sw2

int vlan10

ip add 192.168.10.253 255.255.255.0

vrrp 10 ip 192.168.10.1

vrrp 10 priority 150

vvrp 10  preempt

vvrp10 track fast 0/1 20

int vlan20

ip add 192.168.20.253 255.255.255.0

vrrp 20 ip 192.168.20.1

vrrp 20 priority 160

vrrp 20  preempt

vrrp 20 track fast 0/1 20

 

 

mstp多生成树

sw1

spanning-tree  开启生成树

spanning-tree  mode mstp 模式为多生成树

spanning-tree mst config  配置

instance 10 vlan 10  10关联vlan10

instance 20 vlan 20 20关联vlan20

spanning-tree mst config 10 priority 4096 优先级 必须最低0 或者4098

spanning-tree mst config 20 priority 8192

sw2

spanning-tree

spanning-tree  mode mstp

spanning-tree mst config

instance 10 vlan 10

instance 20 vlan 20

spanning-tree mst config 20 priority 4096

spanning-tree mst config 10 priority 8192

sw3

spanning-tree

spanning-tree  mode mstp

spanning-tree mst config

instance 10 vlan 10

instance 20 vlan 20