1、左边是vlan 10主桥,右边是vlan 20的主桥,并且互为备桥
2、 vlan 10 vrrp网关默认用左边,vlan 20的vrrp 网关默认用右边,对应mstp生成树
3、两边都track检测,不通就把vrrp减掉60,这样就会自动切另一边了
4、两边vlan 10和20 都启用dhcp代理,帮助pc获取路由器上的地址
dhcp enable
ip pool vlan10
gateway-list 192.168.10.254
network 192.168.10.0 mask 255.255.255.0
dns-list 8.8.8.8
ip pool vlan20
gateway-list 192.168.20.254
network 192.168.20.0 mask 255.255.255.0
dns-list 8.8.8.8
interface GigabitEthernet0/0/0
ip address 10.0.0.1 255.255.255.0
ospf enable 1 area 0.0.0.0
interface GigabitEthernet0/0/1
ip address 10.0.1.1 255.255.255.0
ospf enable 1 area 0.0.0.0
dhcp select global
interface GigabitEthernet0/0/2
dhcp select global
interface NULL0
interface LoopBack0
ip address 1.1.1.1 255.255.255.255
ospf enable 1 area 0.0.0.0
ospf 1 router-id 1.1.1.1
default-route-advertise always
area 0.0.0.0
vlan batch 10 20 100
stp instance 1 root primary
stp instance 2 root secondary
dhcp enable
ip relay address cycle //多dhcp服务器时负载
stp region-configuration
region-name a
instance 1 vlan 10
instance 2 vlan 20
active region-configuration
drop-profile default
dhcp server group vlan10
dhcp-server 10.0.0.1 0
dhcp-server 10.0.1.1 1
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 105
vrrp vrid 10 track interface GigabitEthernet0/0/1 reduced 60
vrrp vrid 10 track interface GigabitEthernet0/0/2 reduced 60
ospf enable 1 area 0.0.0.0
dhcp select relay
dhcp relay server-select vlan10
interface Vlanif20
ip address 192.168.20.1 255.255.255.0
vrrp vrid 20 virtual-ip 192.168.20.254
ospf enable 1 area 0.0.0.0
dhcp select relay
dhcp relay server-select vlan10
interface Vlanif100
ip address 10.0.0.2 255.255.255.0
ospf enable 1 area 0.0.0.0
interface MEth0/0/1
interface GigabitEthernet0/0/1
port link-type access
port default vlan 100
interface GigabitEthernet0/0/2
port link-type trunk
port trunk allow-pass vlan 10 20
interface GigabitEthernet0/0/3
port link-type trunk
port trunk allow-pass vlan 10 20
ospf 1 router-id 2.2.2.2
area 0.0.0.0
vlan batch 10 20 200
stp instance 1 root secondary
stp instance 2 root primary
dhcp enable
ip relay address cycle
diffserv domain default
stp region-configuration
region-name a
instance 1 vlan 10
instance 2 vlan 20
active region-configuration
drop-profile default
dhcp server group vlan10
dhcp-server 10.0.0.1 0
dhcp-server 10.0.1.1 1
interface Vlanif10
ip address 192.168.10.2 255.255.255.0
vrrp vrid 10 virtual-ip 192.168.10.254
ospf enable 1 area 0.0.0.0
dhcp select relay
dhcp relay server-select vlan10
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 105
vrrp vrid 20 track interface GigabitEthernet0/0/1 reduced 60
vrrp vrid 20 track interface GigabitEthernet0/0/2 reduced 60
ospf enable 1 area 0.0.0.0
dhcp select relay
dhcp relay server-select vlan10
interface Vlanif200
ip address 10.0.1.2 255.255.255.0
ospf enable 1 area 0.0.0.0
interface MEth0/0/1
interface GigabitEthernet0/0/1
port link-type access
port default vlan 200
interface GigabitEthernet0/0/2
port link-type trunk
port trunk allow-pass vlan 10 20
interface GigabitEthernet0/0/3
port link-type trunk
port trunk allow-pass vlan 10 20
ospf 1 router-id 3.3.3.3
area 0.0.0.0
vlan batch 10 20
stp region-configuration
region-name a
instance 1 vlan 10
instance 2 vlan 20
active region-configuration
interface MEth0/0/1
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 10 20
interface GigabitEthernet0/0/2
port link-type trunk
port trunk allow-pass vlan 10 20
interface GigabitEthernet0/0/3
port link-type access
port default vlan 10
stp edged-port enable
interface GigabitEthernet0/0/4
port link-type access
port default vlan 20
stp edged-port enable