cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2344
Views
4
Helpful
8
Replies

Different AS Prepend for advertised subnets

dylan.ebner
Level 1
Level 1

I currently advertise 2 class c subnets to two different ISPs using one ASN. Is it possible to pre-pend subnet1 more (or less) than subnet 2 to an ISP? Currently one one of my routers I have the following:

router bgp 1xxxx

network xx.xxx.134.0 mask 255.255.255.0

network xx.xxx.55.0 mask 255.255.255.0

neighbor xx.xxx.59.197 route-map PrePend out

neighbor xx.xxx.59.197 filter-list 10 out

ip as-path access-list 10 permit ^$

route-map PrePend permit 10

set as-path prepend 1xxxx 1xxxx 1xxxx

Basically, I would like to be able to prepend the xx.xxx.134.0/24 serveral times, while only pre-pending the xx.xxx.55.0/24 once.

Or maybe there is a better way to do this?

Any thought are appreciated

1 Accepted Solution

Accepted Solutions

Jon Marshall
Hall of Fame
Hall of Fame

Not sure whether there is a better way as you don't say what you are trying to achieve.

To answer your specific question then yes, you can -

1) use a prefix list per network you want to advertise

2) with your route map have multiple permit statements one for each network then match with the prefix list and set the number of AS instances you want to prepend

Jon

View solution in original post

8 Replies 8

Jon Marshall
Hall of Fame
Hall of Fame

Not sure whether there is a better way as you don't say what you are trying to achieve.

To answer your specific question then yes, you can -

1) use a prefix list per network you want to advertise

2) with your route map have multiple permit statements one for each network then match with the prefix list and set the number of AS instances you want to prepend

Jon

Thanks for the reply Jon.

Here is what I am trying to accomplish. I want to make sure traffic to my first advertisements is always preferenced to my first ISP and my second advertisement is always preference to my second ISP.

So, would the prefix-list and route-map look something like this:

ip access-list extended SUBNETA

permit ip xx.xx.134.0 0.0.255 any

ip access-list extended SUBNETB

permit ip xx.xx.55.0 0.0.0.255 any

route-map SUBNETA-prepend permit 10

match policy-list SUBNETA

set as-path prepend 1xxxx 1xxxx 1xxxx

route-map SUBNETB-prepend permit 10

match policy-list SUBNETB

set as-path prepend 1xxxx

And then applying it to the BGP session:

router bgp 1xxxx

neighbor xx.xxx.59.197 route-map SUBNETA-prepend out

neighbor xx.xxx.59.197 route-map SUBNETB-prepend out

I should mention I am using ASR1001.

Thanks

Here is what I am trying to accomplish. I want to make sure traffic to my first advertisements is always preferenced to my first ISP and my second advertisement is always preference to my second ISP.

So you have two ISP connections and you want one ISP preferred for one network and one for the other ?

If so why not just -

1) for ISP1 prepend the route you want to go via ISP2

2) for ISP2 prepend the route you want to go via ISP1

not sure why you need to prepend both to each ISP ?

Jon

Yes, that is the ultimate goal. We have always kept a prepend route-map active on both routers in the event we have some major latency / performance issue with an isp. then the support people can quickly run a script which adds to the prepend on the affected router and do a soft bgp out update.

I think I had my previous statements wrong though. I think is should be:

ip prefix-list SUBNETA permit xx.xxx.134.0/24

ip prefix-list SUBNETB permit xx.xxx.55.0/24

route-map PrePend permit 10

match ip address SUBNETA

set as-path prepend 1xxxx 1xxxx 1xxxx

route-map PrePend permit 20

match ip address SUBNETB

set as-path prepend 1xxxx

then on the bgp config:

neighbor xx.xxx.59.197 route-map PrePend out

Okay, that makes more sense.

Yes your last config looks fine.

Jon

Thanks Jon.

Do you mind if I pick your brain for a minute? Would it be possible to build a route-map that sets a preprend for one remote AS and then has a different prepend for all other ASs?

To give you some background here, I have a client that has one ISP who primarily peers with Cogent. I peer with CenturyLink and Comcast. Cogent and CL are having congestion issues. If I set my prepend 3 or 4 times on my CL link I can force the traffic to my comcast connection. But this affects all my clients. Would it be possible to attempt to force the single ISP to use my comcast connection through a route-map that only prepends for their AS?

thanks

Do you mind if I pick your brain for a minute?

Sure, although it's not very big so there is only a limited amount of information in there

I don't think there is a way to do this as when you prepend a route it is an all or nothing thing. There is no way, as far as i know, to specify that a route advertisement should only apply to a specific remote AS but not to others.

Like i say i do not know a way to achieve what you want but may be others can add to this.

Jon

dylan.ebner
Level 1
Level 1

Thanks Jon.

That was my understanding also. Currently I am trying to use a CL community that will prepend my advertisement to Cogent, but CL doesn't appear to be honoring the community string. Hopefully they will let me know what is going on.

I appreciate all your help

Dylan

Review Cisco Networking products for a $25 gift card