cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
3278
Views
0
Helpful
7
Replies

bgp as-path prepend

whanson
Level 2
Level 2

Customer is connected to two ISPs and is advertising out 3 networks. I want to set it up so network A prefers isp y and network B and C prefer isp y. I did the following

neighbor isp x route-map as-path-ispy out

access-list 20 permit network A

route-map as-path-ispy permit 10

match ip address 20

set as-path prepend 1400 1400 1400

like logic for other provider

It did not do what I thought at all. Is setting as-path only for all routes and can't be done on a route by route basis?

7 Replies 7

Harold Ritter
Cisco Employee
Cisco Employee

Bill,

AS path prepending can certainly be done on a prefix by prefix basis. Bear in mind that prepending the prefix does not necessarily mean your provider will not select it as the best path anyway.

Most providers will, by default, set a local preference on all prefixes they receive so they are preferred in the following order.

- Customer prefixes

- Peer prefixes

- Transit prefixes

So even though the AS path might be longer, your provider might still prefer it over prefixes received from peers or transit providers based on the local preference attribute setting.

Is that what you meant by "it did not do what I thought"?

Regards

Harold Ritter
Sr Technical Leader
CCIE 4168 (R&S, SP)
harold@cisco.com
México móvil: +52 1 55 8312 4915
Cisco México
Paseo de la Reforma 222
Piso 19
Cuauhtémoc, Juárez
Ciudad de México, 06600
México

What I meant was, doesn't the prepend get propagated across AS? and if I say I add

my AS number 3 times going toward one provider for a particular subnet that I am advertising no matter what, from the rest of world point of view the preferred route is never going to be toward the provider that is showing the multiple AS path to me? That is what I expected but that's not what happened.

example

I have two subnets I am advertising to isp A and isp B

1.1.1.0

2.2.2.0

All being equal there are a number of factors that will influence whether traffic toward 1.1.1.0 or 2.2.2.0 will enter me via isp A or isp B. However, to me if I advertized 1.1.1.0 and 2.2.2.0 to ISP A and prepend my AS multiple times, it seems to me that traffic destined for 1.1.1.0 or 2.2.2.0 will always come via ISP B because it will have the shortest AS path. My question is that when I create the route-map to influence the AS-PATH can it be done on a subnet by subnet basis by matching on an address in the route map? If so, then I am puzzled why it didn't work. I artificially increased the AS-PATH length for all networks going to ISP A yet I continued to see traffic coming in vial ISP A anyway.

Bill,

As I explained in my previous post, the as path length is not the first thing to be considered when comparing to BGP paths. For instance, the local preference as a higher preference in the BGP best path selection algorithm.

This means that if your provider sets the local preference higher for their customer routes than for their peer and transit routes, the longer as path will have no affect and the routes received directly from you will be preferred even anyway.

One way to address this is to verify whether your provider allow you to influence the local preference value they will use on your directly received prefixes. Providers very often allow this to happen by looking at community values received from you and set the value accordingly.

For example, let's say your provider is 60999, they would accept the following value and act accordingly:

60999:70 sets the local preference to 70

60999:80 sets the local preference to 80

and so on

If your provider offer tat possibility, it will allow you to tell your provider to prefer peer and transit routes over your directly received routes via the local preference setting.

Regards

Harold Ritter
Sr Technical Leader
CCIE 4168 (R&S, SP)
harold@cisco.com
México móvil: +52 1 55 8312 4915
Cisco México
Paseo de la Reforma 222
Piso 19
Cuauhtémoc, Juárez
Ciudad de México, 06600
México

I defer to your expertise but from what I read about local preference this is something my provider can set on incoming routes. I can't set it toward them. It is an internal AS not cross AS. Even so to me it is irrelevant. So what if provider A or provider B sets a local preference. This can't go beyond their AS boundary. AS path should be propagated across AS boundaries. I don't understand you comment about transit routes. These are not transit routes, they are direct to each provider. Believe me, I would like to understand this better.

Hello Bill,

Harold is suggesting to verify if the ISP accepts BGP communities as a way to influence his own local preference settings.

if so you need to mark the routes with the required BGP community value with a route-map applied outbound to ISP eBGP session and to enable the sending of BGP communities to the neighbor

something like

router bgp your.AS

neigh isp.peer.address route-map setBGPcom out

neigh isp.peer.address send-community

route-map setBGPcom permit 10

match ip address prefix your_routes

set community

but the value to be used is known to your provider.So you need to contact them.

Hope to help

Giuseppe

I am not an expert,

Assuming both the ISP's are on single router. you can influnce the out bound traffic using route-map with acl or prefix list OR configuring WEIGHT.

Inbound traffic can be influenced by prepending the desired isp with AS-PATHS.to achive this destination router should be connected with both isp's.

or

Configuring WEIGHT at destionation location will also influence the desired inbound traffic.

AS-PATH prepending works only when you have routes on single router with multipal paths to the destination.

Regards

maahi

I am not an expert,

Assuming both the ISP's are on single router. you can influnce the out bound traffic using route-map with acl or prefix list OR configuring WEIGHT.

Inbound traffic can be influenced by prepending the desired isp with AS-PATHS.to achive this destination router should be connected with both isp's.

or

Configuring WEIGHT at destionation location will also influence the desired inbound traffic.

AS-PATH prepending works only when you have routes on single router with multipal paths to the destination.

Regards

maahi

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:

Review Cisco Networking products for a $25 gift card