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

BGP AS-Path prepending

We are a multihomed ISP with two full BGP peer.

One is connected to a 10Mbit line, the other one is only E1.

We are using AS-path prepending to announce our AS longer over the E1, this way we only get traffic which is "really" good on this upstream provider.

The question is how do we set paths for outgoing traffic?

Right now I see almost every network 1 AS-hop shorter on the E1, but we want the majority of the traffic going out on the 10Mbit link.

So I use local weights to push *every* traffic on the 10Mbit.

Is there a possibility to prepend the *incoming* AS-path? So that I can add one AS-hop to every AS learned via E1?



New Member

Re: BGP AS-Path prepending

You can't define the policy that how to enter the traffic in your network.

you can use the med attribute to configure your router EBGP paths

New Member

Re: BGP AS-Path prepending


Manipulating the AS-PATH and the MED is to

influence the entrance (inbound traffic) .

To influence the exit (outboud traffic) You could

use the "local_pref" attribute .

Presume You are using single router to terminate

the 2 link , so "weight" is almost as good as

"Local_Pref" . In case 2 routers are used U side so

the use of "Local_Pref" is mandatory ("weight" is

local to the router and not propagated within

the AS ).

IF U still need to influence the exit by using

the AS-PATH attribute U could manipulate the

incoming AS-PATH but U have to prepend the provider

AS nbr not your's .


New Member

Re: BGP AS-Path prepending

You can either prepend the last ISP AS as needed and advertise out to IBGP peers or you can set the local preference for routes which would also be communicated to IBGP peers within your AS.

I would use the local preference. If you have other EBGP peers that you also need to provide routing policy for, you may want use the path prepending to span the ASs

New Member

Re: BGP AS-Path prepending

Have you tried using a route-map to set local pref higher on the 10MB. Example:

router bgp "Your AS"

neighbor "10Mb AS#" route-map LOCPREF in

ip as-path access-list 90 permit "use reg exp to list AS path"

route-map LOCPREF permit 10

match as-path 90

set local-preference 200


route-map LOCPREF permit 20

This route-map will set local pref to 200 for all matching AS pathes listed in the "ip as-path access-list 90". Default is 100 so your out bound traffic will perfer the higher local pref.

Also check out "Internet Routing Architectures 2nd Edition"

New Member

Re: BGP AS-Path prepending

One thing you might consider is asking your providers (especially the one with the smaller connection) to send you bgp community information.

Most providers can give you "customers-only" communities. Since this minority of routes will likely perform better through this provider, you'd want to take advantage of that. You'd do this by using a route-map to increase the localpref of those routes.

You'd set

all customer routes from provider A to localpref of 200,

all other routes from them to localpref of 90

and all routes from provider B to localpref of 100.

The other choice would be to select all routes that terminate in the provider's AS to a higher localpref. This is generally a smaller subset than all customer routes.

I'm pretty sure there's a good example on cisco's web page.

Most reasonable-size and up ISP's can support this configuration.

CreatePlease to create content