Route-map and match command to different things

Unanswered Question
Apr 7th, 2009
User Badges:

Hi,

I wonder if anyone can help with my concern. Let's say we have 100 subnets. I want to prepend only half of them. So I'll build a route-map applyed on BGP neighbor matching the prefix-list of all those subnets and setting a prepend. But how to prepend only half of them? doing match one prefix-list and than match the other I think has and in between so set prepend will match both. Please help

  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 4 (3 ratings)
Loading.
royalblues Tue, 04/07/2009 - 08:23
User Badges:
  • Green, 3000 points or more

Create a seperate prefix-list for the subnets u need to do as prepend and configure a route-map


something like this


R1


router bgp 1

no synchronization

bgp log-neighbor-changes

network 1.0.0.0

network 2.0.0.0

neighbor 10.10.10.2 remote-as 2

neighbor 10.10.10.2 prefix-list out out

neighbor 10.10.10.2 route-map prepend out

no auto-summary


ip prefix-list prependlist seq 10 permit 1.0.0.0/8


route-map prepend permit 10

match ip address prefix-list prependlist

set as-path prepend 1 1 1 1

route-map prepend permit 20


R2

router bgp 2

no synchronization

bgp log-neighbor-changes

neighbor 10.10.10.1 remote-as 1

no auto-summary


R2#sh ip bgp

BGP table version is 13, local router ID is 10.10.10.2

Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,

r RIB-failure, S Stale

Origin codes: i - IGP, e - EGP, ? - incomplete


Network Next Hop Metric LocPrf Weight Path

*>1.0.0.0 10.10.10.1 0 0 1 1 1 1 1 i

*> 2.0.0.0 10.10.10.1 0 0 1 i


HTH

Narayan

Matt qomat Wed, 04/08/2009 - 06:33
User Badges:

So if you have let say 3 subnets and you want them all advertise but only two of them to prepand. Based on your notes I thought about


route-map prepend permit 10

match ip address prefix-list prependlist

set as-path prepend 1111

route-map prepend permit 20

match ip address prefix-list 3rdsubnet


So that should prepned all the subnets from prependlist and send clear 3rd, right?



royalblues Wed, 04/08/2009 - 06:44
User Badges:
  • Green, 3000 points or more

No need to match anything under the second route map


route-map prepend permit 10

match ip address prefix-list prependlist

set as-path prepend 1111

route-map prepend permit 20


will do .. include only the subnets that u want to have as path prepends as part of prefix-lists


Narayan

subra4u Wed, 04/08/2009 - 07:01
User Badges:

Hi,


Can the same be achieved just using an access list in the route-map like


route-map prepend permit 10

match ip address 3

set as-path prepend 1111

route-map prepend permit 20


ip access-list 3 permit X.X.X.X


if we dont have to add anything under route-map prepend permit 20 then why are doing this command exactly


thanks in advance


subra

royalblues Wed, 04/08/2009 - 07:15
User Badges:
  • Green, 3000 points or more

Subra


If you dont add the 2md route-map command, it will only send out the prefixes that match the list and filter everythign else


The 2nd map actually will ensure all the other prefixes which are not to be prepended to be matched and advertised.


use of prefix-lists are more beneficial as it uses CIDR notation


HTH

Narayan

Matt qomat Wed, 04/08/2009 - 12:17
User Badges:

But I also have subnets that I do not want to advertise. So its not like all other will not be prepended. I guess i do need match those that will not be prepended so that site act as originator.

royalblues Wed, 04/08/2009 - 12:24
User Badges:
  • Green, 3000 points or more

Yes thats correct..


Create a sperate prefix-list and match them under the 2nd route-map but do not add any set command


Narayan

Actions

This Discussion