Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements

Welcome to Cisco Support Community. We would love to have your feedback.

For an introduction to the new site, click here. If you'd prefer to explore, try our test area to get started. And see here for current known issues.

class-map match-all or match-any: exact difference

What is the exact difference between match-all & match-any?

from:

http://www.cisco.com/en/US/products/hw/switches/ps708/products_command_reference_chapter09186a0080161029.html#wp1021242

it states the following:

class-map

To access the QoS class map configuration mode to configure QoS class maps, use the class-map command. To delete a class map, use the no form of this command.

class-map name [match-all | match-any]

no class-map name [match-all | match-any]

Syntax Description

name

Class map name.

match-all

(Optional) Matches all match criteria in the class map.

match-any

(Optional) Matches one or more match criteria.

Defaults

When you do not specify the match-all or match-any keyword, the default is match-all.

So, if I have 6 match lines under my class, would match-any & match-all behave the same?

The definition seems very vague to me

Thanks,

Eric

1 ACCEPTED SOLUTION

Accepted Solutions
Silver

Re: class-map match-all or match-any: exact difference

Hello.

In Match-any:

Any one line has to match for match to occur.

In Match-all:

ALL lines have to match for match to occur.

I.E.:

1.

class-map match-all ABC

match access-group 10

match access-group 20

--In this case packet has to match both ACL 10 AND ACL 20

2.

class-map match-any ABC

match access-group 10

match access-group 20

--In this case packet has to match AT LEAST one access list.

Hope this helps.

Please rate if it does.

3 REPLIES
Silver

Re: class-map match-all or match-any: exact difference

Hello.

In Match-any:

Any one line has to match for match to occur.

In Match-all:

ALL lines have to match for match to occur.

I.E.:

1.

class-map match-all ABC

match access-group 10

match access-group 20

--In this case packet has to match both ACL 10 AND ACL 20

2.

class-map match-any ABC

match access-group 10

match access-group 20

--In this case packet has to match AT LEAST one access list.

Hope this helps.

Please rate if it does.

Re: class-map match-all or match-any: exact difference

Thanks, That is a clearer explanation

Cisco Employee

Re: class-map match-all or match-any: exact difference

Hi Eric,

If you have 6 statements under your class and you have "match all" keyword selected than class map will be triggered only if all statements hold true so for class to come in action all 6 statements/conditions should match and if you have selected "match any" keyword then any of the statement hold true out of 6, class map will trigger.

HTH

Ankur

3448
Views
0
Helpful
3
Replies