bgp bestpath as-path ignore?

Unanswered Question
Jul 24th, 2007
User Badges:
  • Bronze, 100 points or more

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?


  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 5 (1 ratings)
Edison Ortiz Tue, 07/24/2007 - 06:59
User Badges:
  • Super Bronze, 10000 points or more
  • Hall of Fame,

    Founding Member

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

sundar.palaniappan Tue, 07/24/2007 - 07:04
User Badges:
  • Green, 3000 points or more


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.



philip moore Thu, 08/12/2010 - 03:39
User Badges:

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.


This Discussion