Showing results for 
Search instead for 
Did you mean: 

BGP default route selection

Darren Sasso

I'm trying to determine the best way to prefer 1 default route over the other. I have a dozen or so remote sites and all of them need to prefer the same default route except for 1 location. I've prepended my AS to the less desirable default route and all works as expected, but 1 of the sites needs to use the default route from the less desirable location. I'm advertising communities at all locations so what i tried is to match these communities and set local preference and weight but it still prefers the shorter AS path. I'm just looking for some ideas on how to do this outside of blocking the default locally i don't want to use.

Thanks in advance.

9 Replies 9

cisco steps

use the path w/ the highest local perferences for all other route and then create a ACL for the one you don't want to follow that choosen path on the router

Hope this helps

if i were to do that i would have to touch every router. i want to prepend so the default goes through 1 location and just make an exception for this one site. Is there a reason matching communities and setting the local preference higher for this one site wouldn't work because it still selects the shortest as-path?

i think Darren's is such that:

- all remote site learn default route originating from 2 AS or 1 AS.

- a particular remote site wants to prefer default route originate with the longer AS-PATH.

can you confirm this is the scenario, and how many AS is originating the default route?

Hello Darren,

you should set rise the local-preference or weight with a route-map applied inbound on the single remote site that has to use the default route with the longer AS path.

neigh x route-map rise_locpref in

also you need to select the BGP next-hop of the path you want to prefer

access-list 11 permit host

ip prefix-list only-default permit

route-map rise_locpref permit 10

match ip prefix-list only-default

match ip next-hop 11

set local-preference 200

Then you may need to clear the ip bgp session (use soft option) to see the effect

Hope to help


Hi Giuseppe. Thanks for the information.

Everything you said is pretty much what i'm doing but i'm unable to match next-hop because both default routes are coming from the same PE which has the same next-hop. I think thats why i'm running into the problem. See the attached diagram of the layout. RE is the remote site and HK & SiteA are the locations originating the default route. I'm prepending from SiteA so no site prefer it except RE.

Hello Darren,

>> because both default routes are coming from the same PE which has the same next-hop. I think thats why i'm running into the problem.

In this case RE will receive a single default route the best path from the point of view of PE node.

You need to move routing policy to PE node but I'm not sure this is easy to do.


you need to have two different RDs to have both advertised to PE node but when PE node prepares updates for the CE node RE if there is an eBGP session in VRF it will send out a single message.

Only if the vpnv4 routes arrive on RE you can make a choice on this node.

Hope to help


Hi Giuseppe,

I'll go back to my MPLS provider and see what they can do.

Thanks again for your help!

if this becomes hard for your provider, there's always option to use gre tunnel.

since there is only one remote site require this special case for default route only it wouldn't be hard to manage.

We are also testing that as well. We anticipate more site similar and i'm sure our provider can prefer 1 default over the other, so i'll see what they come back with.

Thanks for everyones help!

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Recognize Your Peers