Tuesday, October 15, 2013

match-any vs match-all

MATCH-ANY is OR logic, MATCH-ALL is AND logic

The difference is how many LINES, not how many options.

Same line will always be OR logic.

So you could have:

class-map match-all test1
match ip precedence 2 3 4
match protocol http

And the things you'll get are:

HTTP + Prec2
HTTP + Prec3
HTTP + Prec4

Both lines MUST be matches.

Example : 1

class-map match-all test1
match ip precedence 2 3 4
match protocol http

The class-map is AND logic between each line.  So the match ip prec must be true as well as match protocol http.  The match ip precedence is OR logic within that single line.

Example : 2

class-map match-any test1
match ip precedence 2
match ip precedence 3
match ip precedence 4
match protocol http

"Match-any" is OR logic between each line in the class-map.  If any of those entries hold true.  So if ip prec is 2, 3, 4, or if the traffic is http the class-map will have a match.  The following would be true.

Prec/protocol
0/http
2/any proto
3/any proto
4/any proto
5/http
6/http
7/http

No comments: