03-26-2009 02:39 AM - edited 03-04-2019 04:06 AM
Is there any way to match same criteria and achieve a "AND" functionality in route-map?
like this
route-map xxx permit 10
match ip address prefix-list EQ
match ip address prefix-list BQ
when i do this it will go to same line like "match ip address prefix-list EQ BQ" and will do a "OR" operation.
Is there any other way i can achieve a "AND" ?
I found in a old post( link given below) as its impossible -
is there anyone using this ?
03-26-2009 02:46 AM
Hello Rajeev,
you can have an AND for match of different fields / attributes not for the same type of match
you could easily build impossible and conditions like
match ip prec 0 and match ip prec 5
so the IOS logic aggregates similar in one single entry with or of refenced ACLs.
create a new prefix-list that makes all the checks you want to do and use it
Hope to help
Giuseppe
03-26-2009 02:54 AM
hi Giuseppe ,
thnx a lot but can u pls explain how to do
" match ip prec 0 and match ip prec 5 "
is it posible to match ip prefix-list 1 & 2 ?
03-26-2009 07:07 AM
thnx a lot but can u pls explain how to do
" match ip prec 0 and match ip prec 5 "
How can a packet have both values within the 'ip precedence' field ?
__
Edison.
03-26-2009 07:24 AM
Hello Rajeev,
>> how to do
" match ip prec 0 and match ip prec 5 "
this is the point: it is impossible for an IP packet to satisfy both conditions
this was an example to explain why IOS behaves in this way
Hope to help
Giuseppe
03-26-2009 03:33 PM
And operation should be done as follows:
route-map test permit 10
match ip add prefix-list test1 test2
set tag=13
What this means is the route-map can either match test1 or test2. Doing it the stacked way as you mentioned would mean it has to match both criteria.
If that's not working as expected, add another line in the sequence...IE
route-map test permit 10
match ip add prefix-list test1
set tag=13
route-map test permit 20
match ip add prefix-list test2
set tag=13
This way you're not confusing the and/or logic.
Hope this helps, rate if it does!
JB
03-27-2009 10:46 PM
hi JB and friends,
Thanks for the reply and support.
But JB,
when route-map matches the first sequence , it will exit ( or it will no more process the other sequences exactly like a access-list)
My requirement is an AND process of prefix-lists, like test 1 and test 2 should be matched and some advertisement should be done based on that in bgp.
if its what ur trying to explain ... can u please tell me how the above example will do that ..
it will be of great help if this solves my issue.
03-28-2009 08:36 AM
From what you described, you want one route to match both access-list/prefix-list? That should be the following:
route-map test permit 10
match ip add prefix-list test1
match tag 20
set tag=13
That should have the route-map match test1 and test2. It has to match both conditions before setting the tag of 13.
Hope this helps, rate if it does,
JB
03-30-2009 04:39 AM
hi,
Thnx JB for replying.
Requirement is like this:
For bgp conditional advertisement,i.e exist-map and advertise-map, I have to match multiple prefixes availability in bgp table.
So route map has to match multiple prefix lists ( either prefix list or access-list it has to match more than 5 networks in bgp table before start advertising to neighbor)
now route-map has to match multiple prefixes ( availability in bgp table).So i need a "AND" process of prefixes in a single route-map.
Hope u got the requirement.pls let me know in case of any confusions.
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