04-07-2009 06:54 AM - edited 03-04-2019 04:16 AM
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
04-07-2009 08:23 AM
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
04-08-2009 06:33 AM
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?
04-08-2009 06:44 AM
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
04-08-2009 07:01 AM
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
04-08-2009 07:15 AM
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
04-08-2009 12:17 PM
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.
04-08-2009 12:24 PM
Yes thats correct..
Create a sperate prefix-list and match them under the 2nd route-map but do not add any set command
Narayan
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