FHRP - interaction with routing protocols
When deploying a FHRP such as Hot Standby Router Protocol (HSRP) or Virtual Router Redundancy Protocol (VRRP), along with routing protocols such as OSPF or EIGRP, there are some best practices that should be kept in mind.
It’s important to realize that FHRPs typically deliver a default gateway to subnets that contain end user hosts. So the actual virtual gateway that is created should only be facing the subnet where the end users are. Those end users should be using that virtual gateway as their default gateway.
Any routing protocols that FHRP devices participate in should take place on other interfaces and not those of the virtual router.
In other words, the virtual default gateway and the SVIs or routed interfaces associated with it should not be used to create OSPF neighbor adjacencies.
Indeed, those interfaces should ideally be configured as passive interfaces for the routing protocol being used.
Take a look at the following FHRP topology:
In such a topology, the Gi0/1 interfaces of the switches as well as any host-facing SVIs should be configured as passive for whatever routing protocol may be employed. The Gi0/2 interfaces of the switches as well as those of R3 can be used to create routing protocol peerings for the exchange of routing information.
Links
https://forum.networklessons.com/t/hsrp-hot-standby-routing-protocol/1150/176?u=lagapides