10-25-2011 06:17 AM - edited 03-04-2019 02:02 PM
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.
10-25-2011 06:23 AM
Hi,
you're missing the route-map name. It should be:
Route-map permit prepend As 10
Set As path 65000 65000
Regards.
Alain.
10-25-2011 06:51 AM
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.
10-25-2011 07:11 AM
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
10-25-2011 07:16 AM
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.
10-25-2011 07:21 AM
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..
10-25-2011 07:23 AM
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...
10-25-2011 07:29 AM
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
10-25-2011 07:34 AM
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
10-25-2011 07:30 AM
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.
10-25-2011 07:37 AM
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
10-25-2011 07:43 AM
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
10-25-2011 07:45 AM
Ok...got it...
Do you suggest any changes in the config i posted. ?
10-25-2011 07:53 AM
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
10-25-2011 07:58 AM
Thank you Vaibhav and Alain..I will implement this and let you know how it goes
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide