cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2297
Views
13
Helpful
28
Replies

Question_As_Path_Prepend

Vinayaka Raman
Level 1
Level 1

All the branch end MPLS routers injects sites BGP prefix in to the service provider’s cloud by forming EBGP neighbhorship with PE.

In my scenario, I need to inject same prefix from two of the branches so that the actual MPLS route is always better than the other backup route.

This back route is static to BGP redistributed route. While redistributing I want to prepend AS so that it becomes the worst route. Right now, MED is configured and it is not working as expected because the service provider is hoping through Multiple AS for the actual MPLS route.

Router bgp 65000

Redistribute static route-map prepend As

Route-map permit 10

Set As path 65000 65000

This isn’t working .  Do you have some suggestion ?

I will post the actual error message in a while.

Regards Vinayak
28 Replies 28

cadet alain
VIP Alumni
VIP Alumni

Hi,

you're missing the route-map name. It should be:

Route-map permit prepend As 10

Set As path 65000 65000

Regards.

Alain.

Don't forget to rate helpful posts.

Router bgp 65000

Ip route X.X.X.X Y.Y.Y.Y next hop 150

redistribute static route-map Prepend_AS

Route-map Prepend_AS 10

Set As path 65000 65000

sorry for the typo...

I forget the exact error message. While I issue this redistribute command It throws me an error like this is not possibl

I will post the error message soon.

Is this configuration correct ?

My intention is to prepend the AS after redistributing from static to bgp and then advertise to eBGP peer.

Regards Vinayak

Hi Raman

If we need to prepend the AS-Path which is being advertised to other BGP Peers the best way is t first redistribute the Static ROutes into BGP Process and then apply an outbound route-map on per neighbiur basis under BGP config which prepends the AS. I wonder if the redistribution of Static ROutes into BGP and same time prepending will be allowed or not.

The solution for prepending would be as follows:

route bgp 65000

neighbour x.x.x.x route-map Prepend_AS out

redistribute static

!

Ip route X.X.X.X Y.Y.Y.Y next hop 150

!

route-map Prepend_AS permit 10

set as-path prepend 65000 65000

Hope this helps to answer your query.

Regards

Varma

Hi,

the correct config should be set as-path prepend 65000 65000  but you should configure this like this:

neighbour x.x.x.x route-map Prepend_AS out

Because AS_PATH prepending is for advertising BGP prefixes not for redistributing static routes.

I still wonder how I didn't realize it at first look.

Alain.

Don't forget to rate helpful posts.

I wanted only the redistributed static routes to be prpended with AS..

So do you want me to create a prefix list and match under route-map..

Regards Vinayak

Forgot to mention i have 2 more major prefixes advertisde from my CE to PE, i dont want to prpend that...

only i want to prepend the static to bgp redistributed routes...

Regards Vinayak

Hi Raman

If we want to prepend only specific prefix then we need to have 2 terms in the outbound route-map:

1. Term 10 for prepending the required prefixes matched via a Prefix-List and prepend the AS-Path

2. Term 20 to allow everything else remaining un-prepended

route bgp 65000

neighbour x.x.x.x route-map Prepend_AS out

redistribute static

!

Ip route X.X.X.X Y.Y.Y.Y next hop 150

!

route-map Prepend_AS permit 10

match ip address prefix-list Prepend_AS

set as-path prepend 65000 65000

!

route-map Prepend_AS permit 20

!

ip prefix-list Prepend_AS seq 5 permit x.x.x.x/24

Hope this helps to answer your query.

Regards

Varma

route bgp 65000

neighbour x.x.x.x route-map Prepend_AS out

redistribute static

!

Ip route X.X.X.X/24 next hop 150

Ip route Z.Z.Z.Z/24 next hop 150

!

route-map Prepend_AS permit 10

match prefix-list Static-routes

set as-path prepend 65000 65000

route-map Prepend_AS permit 20

Ip prefix-list Static-routes permit  X.X.X.X/24

Ip prefix-list Static-routes permit  Z.Z.Z.Z/24

Regards Vinayak

Hi,

yes you can match the prefixes with a prefix-list and prepend them.

Don't forget to add an empty  route-map permit 20 for other prefixes to be advertised.

Alain.

Don't forget to rate helpful posts.

just review and let me know if the configuration looking good.

I had to use Clear ip bgp* for the configs to take effect immediately

Do you suggest an alternate way like

clear ip bgp * soft in

clear ip bgp * soft out

I dont think this worked when i tried for the first time

Regards Vinayak

Hi Raman

In my personal opinion we should never do a hard reset on BGP peers, the soft way which you have mentioned is the most optimal way withiut interrupting traffic flow.

Regards

Varma

Ok...got it...

Do you suggest any changes in the config i posted. ?

Regards Vinayak

Hi Raman

Yes the config logic is correct. I did not look at the syntax typo though. You can refer my sample config snapshot which I shared in earlier post and look in the below excellent cisco docs for config syntax :-)

http://www.cisco.com/en/US/tech/tk365/technologies_tech_note09186a00800c95bb.shtml

Regards

Varma

Thank you Vaibhav and Alain..I will implement this and let you know how it goes

Regards Vinayak
Review Cisco Networking for a $25 gift card