Bgp – Routing traffic out different links from the same BGP AS

bgp

I have two sites, A and B, in BGP AS 65000, and a third site, C, in AS 65001. All three sites have connectivity via carrier MPLS and there is internal connectivity between sites A and B. I am trying to influence BGP so that traffic from site A to site C will be routed via site A's MPLS link, and traffic from site B to site C will route via site B's MPLS link. The topology is similar to what is described in this example.

AS 65000 and 65001

The edge routers at sites A and B will both see their own MPLS link as the best path, because EBGP routes are preferred over IBGP routes. However, routers further inside AS 65000 will all prefer either one link or the other. My goal is to force all the routers at either site to prefer the closest link. (Unfortunately, I'm not able to split the two sites into separate ASes at this time.)

Is there a sane way to accomplish this while still allowing failover connectivity to site C between the site A and B links?

Edit: I should have noted that there is no IGP in use here. In fact, the networks at each site exist within a VRF as part of a much, much larger network. As such, any solution needs to be rely entirely on BGP.

Best Answer

Is there a clear definition between site A and site B?

If so then I would look to define a policy on the edge routers to inject a community when receiving routes from the carrier MPLS.

Once this community has been put on the prefixes (say 100:1 for site A and 100:2 for site B) you could then add a policy to each of site A's routers to increase the LP for any routes with community 100:1 and likewise for site B with community 100:2.

This solution would match the requirement of only using BGP and also would be flexible enough to still allow B to use A's uplink if it lost its own uplink to the carrier.