Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

BGP & Route map statement with multiple matches 1

Status
Not open for further replies.

norteldude78

IS-IT--Management
Nov 10, 2005
214
US
I have been reading about route maps and about the ANDing and ORing of multiple match statements and I am coming up short in a lab...

My acl and route map is as follows:

Code:
access-list 1 permit 2.0.0.0 1.255.255.255
access-list 2 permit 2.2.2.2
access-list 3 permit 4.4.4.4

route-map SETLP2 permit 10
 match ip address 1 2 3
 set local-preference 123

route-map SETLP2 permit 20
 match ip address 1 2
 set local-preference 150

Network statements that match in acl 1 and 2 do exist. ACL 3 has no match. However, my routes for acl 1 and 2 on the BGP neighbor have an LP of 123 instead of 150. This means that:

"match ip address 1 2 3" = match 1 OR match 2 OR match 3

Is this correct??

I then tried the following

Code:
route-map SETLP2 permit 10
 match ip address 1 
 match ip address 2
 match ip address 3
 set local-preference 123

But the router converted this to:
Code:
route-map SETLP2 permit 10
 match ip address 1 2 3
 set local-preference 123

I have seen examples with multiple match statements but my router is not cooperating. I want to get the statements to do an "AND" instead of an "OR". Then my LP would be 150.

After every test I do a "clear ip bgp *" so I know the sessions are cleared.

Can someone explain what I am doing wrong??

If you need more info, I can paste full configs...

Thanks,
-B
 


Like matches in the same route map subblock are filtered with "or" semantics.If any one match clause is matched in the entire route map subblock, this match is treated as a successful match. Dissimilar match clauses are filtered with "and" semantics. So dissimilar matches are filtered logically. If the first set of conditions is not met, the second match clause is filtered. This process continues until a match occurs or there are no more match clauses.

so i read that as your acl match statements are "like statements" therefor they are treated as "or" and the first match acl match will make it successful..

if you were to have match ip address... and a match ip precedence statement.. they would be treated as "and" requirements and both need to be fullfilled to be successful.

make sense?
 
Examples
In the following example, routes that have addresses specified by access list numbers 5 or 80 will be matched:

route-map name
match ip address 5 80
 
Thanks a lot, that explains it. I was under the impression I could do 2 ip address matches, but I guess that would require two route map statements or a wider-scoped ACL.

Thanks!

-B
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top