OSPF vs BGP with anycast prefix

ospf vs bgp anycast

Issue

R3 route traffic to R4 instead of R1. Route 10.10.10.10 toward the WAN is prefered instead of the OSPF LAN DC route. DC Client that try to reach the DC’s 10.10.10.10 address are routed toward the WAN

Why

R3 is installing in it RIB and redistributing the wrong routes 10.10.10.10 because it does have a better AD 20.

Workarround

  • If we filter the redistribution that doesn’t help because when the packet arrive to R3 he will still prefer the BGP route.
  • If we drop the prefix on R3 we loose the redundancy
  • Increase the AD of the WAN route on R3