cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
435
Views
0
Helpful
1
Replies

class map statements

carl_townshend
Spotlight
Spotlight

hi

can anyone tell me why I would need to use the match any, or match all statements in my class map, I have only normally used the match access list command.

thanks

Carl

1 Accepted Solution

Accepted Solutions

Jon Marshall
Hall of Fame
Hall of Fame

carl_townshend wrote:

hi

can anyone tell me why I would need to use the match any, or match all statements in my class map, I have only normally used the match access list command.

thanks

Carl

Carl

If you do this-

class-map CS

match access-group 101

then in fact you are using the "match-all" anyway. Basically when you specify "class-map CS" that is shorthand for "class-map match-all CS". You don't need to specify it because it is the default but if you wanted to specify match-any then you would need to configure "class-map match-any CS".

Now if you are matching against a single access-list it doesn't really matter which you use. But lets say you have this -

class-map CS

match access-group 101

match ip dscp ef

now it makes a big difference which you specify. If you specify match-all then the packet must match the acl 101 and also have the DSCP value of 46 which is EF.

If you specify match-any then the packet only has to match one of the criteria ie. it only needs to either match the acl 101 or have a DSCP value of 46.

So the match-all/match-any gives you more flexibility when there are multiple criteria to match a packet against.

Jon

View solution in original post

1 Reply 1

Jon Marshall
Hall of Fame
Hall of Fame

carl_townshend wrote:

hi

can anyone tell me why I would need to use the match any, or match all statements in my class map, I have only normally used the match access list command.

thanks

Carl

Carl

If you do this-

class-map CS

match access-group 101

then in fact you are using the "match-all" anyway. Basically when you specify "class-map CS" that is shorthand for "class-map match-all CS". You don't need to specify it because it is the default but if you wanted to specify match-any then you would need to configure "class-map match-any CS".

Now if you are matching against a single access-list it doesn't really matter which you use. But lets say you have this -

class-map CS

match access-group 101

match ip dscp ef

now it makes a big difference which you specify. If you specify match-all then the packet must match the acl 101 and also have the DSCP value of 46 which is EF.

If you specify match-any then the packet only has to match one of the criteria ie. it only needs to either match the acl 101 or have a DSCP value of 46.

So the match-all/match-any gives you more flexibility when there are multiple criteria to match a packet against.

Jon

Review Cisco Networking for a $25 gift card