Cisco Support Community
Showing results for 
Search instead for 
Did you mean: 

Welcome to Cisco Support Community. We would love to have your feedback.

For an introduction to the new site, click here. And see here for current known issues.


bgp bestpath as-path ignore?

Hey All,

I'm in the process of designing some backup routing for a eBGP routing infrastructure. I'm having remote sites connect over a backup link to be used in the event of a carrier failure. This works great, but having both paths up the preferred BGP route is the backup link (even with the local pref and metric forced to high numbers). From what I can tell it's because the AS path over the backup link is shorter than over the carrier backbone. In a Cisco document it says you can have BGP ignore this attribute by using "bgp bestpath as-path ignore," but this isn't supported on IOS 12.4. How can I make the preferred routes the ones that have the longer AS path?


Hall of Fame Super Bronze

Re: bgp bestpath as-path ignore?

How about configuring AS_Path prepend on the routes coming from the backup link ?

router bgp 100

neighbor [backup-link] remote-as 200

neighbor [backup-link] route-map ASPATH in

route-map ASPATH permit 10

set as_path prepend 200 200 200

Re: bgp bestpath as-path ignore?


The simple answer to that would be to use the 'weight' attribute. Weight is a Cisco proprietary attribute and is high up on the list before any of the other BGP attributes. Things to know about weight.

1.Route with the highest weight will be installed the routing table.

2. It's local to the router.

3. Not advertised to other routers.

On a side note Local Preference should work in your scenario as well and I am not sure why you can't get it to work.



New Member

Re: bgp bestpath as-path ignore?

this is a very old post, but it came up nonetheless in a google search on the command 'bgp bestpath as-path ignore'

It is true that the command is not supported in IOS 12.4, however it is available as a hidden command and is accepted....

Rack1R3#sh ver | i IOS

Cisco IOS Software, 2800 Software (C2800NM-ADVENTERPRISEK9-M), Version 12.4(24)T1, RELEASE SOFTWARE (fc3)


Enter configuration commands, one per line.  End with CNTL/Z.

Rack1R3(config)#router bgp 200

Rack1R3(config-router)#bgp bestpath as-path ignore

Rack1R3(config-router)#do sh run | i bestpath

bgp bestpath as-path ignore

I hope that helps someone, it did for me
I guess the alternative is to use weight or local preference instead moving forwards, but I like this command especially using in confederations for optimal routing.