08-15-2007 08:23 AM - edited 03-05-2019 05:55 PM
What is the exact difference between match-all & match-any?
from:
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
Solved! Go to Solution.
08-15-2007 08:33 AM
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.
08-15-2007 08:33 AM
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.
08-16-2007 04:58 AM
Thanks, That is a clearer explanation
08-15-2007 08:35 AM
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
01-24-2020 07:29 AM
Hi, one question, What's the recommendation to use, Match-any or Match-all?
Thanks for your comments.
01-24-2020 09:13 AM
06-01-2022 01:28 PM
I guess another way of configuring this would be to have an ACL with multiple permit or/and deny rules and use match-all for your class-map. All depends on your requirements.
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