拓扑图如下
配置交换机,生成树协议
[sw1]stp instance 1 root primary
[sw1lstp ins
[sw1]stp instance 2 r
[sw1]stp instance 2 root sec
[sw1]stp instance 2 root secondary
[sw2]stp mod
[sw2]stp mode mstp
[sw2lstp r
[sw2]stp region-configuration
[sw2-mst-region]in
[sw2-mst-region]instance 1 vl
[sw2-mst-region]instance 1 vlan 2
[sw2-mst-region]instance 2 vl
[sw2-mst-region]instance 2 vlan 3
Isw2-mst-region]ac
[sw2-mst-region]active region-configuration
[sw2]stp instance 1 root secondary
配置vrrp
[sw1-Vlanif2]vrrp vr
[sw1-Vlanif2]vrrp vrid 1 vi
[sw1-Vlanif2]vrrp vrid 1 virtual-ip 192.168.1.1
[sw1-Vlanif3lvrr
[sw1-Vlanif3]vrrp vr
[sw1-Vlanif3]vrrp vrid 2 vi
[sw1-Vlanif3]vrrp vrid 2 virtual-ip 172.16.1.2
配置dhcp
[sw1]ip pool
[sw1]ip pool 1
[sw1-ip-pool-1]network 192.168.1.0 mask 24
[sw1-ip-pool-1]gateway-list 192.168.1.1
[sw1-ip-pool-1]dns-list 8.8
[sw1-ip-pool-1]dns-list 8.8.8.8
[sw1]interface Vlanif 3
[sw1-Vlanif3]dhcp select global