QoSGlobal Config

class-map match-any [name]

Creates a class map that matches traffic if any one of the specified match criteria is true, used to classify traffic for QoS policies.

Syntax·Global Config
class-map match-any [name]

When to Use This Command

  • Classify multiple types of traffic (e.g., HTTP, FTP) into a single class for bandwidth allocation
  • Mark traffic from different source subnets with the same DSCP value
  • Apply policing to a mix of voice and video traffic that share a common ACL
  • Combine different match criteria (e.g., protocol and port) to identify application traffic

Command Examples

Creating a class map to match HTTP or FTP traffic

class-map match-any WEB_AND_FTP
Router(config-cmap)# match protocol http
Router(config-cmap)# match protocol ftp
Router(config-cmap)# exit

The class-map command enters class-map configuration mode. The 'match-any' keyword means traffic matching any one of the subsequent match statements will be classified. Here, HTTP or FTP traffic will match. The 'exit' command returns to global config.

Creating a class map with multiple ACLs

class-map match-any CRITICAL_APPS
Router(config-cmap)# match access-group name VOICE_ACL
Router(config-cmap)# match access-group name VIDEO_ACL
Router(config-cmap)# end

This class map matches traffic that matches either the VOICE_ACL or the VIDEO_ACL. The 'end' command exits to privileged EXEC mode. The class map is now ready to be used in a policy map.

Understanding the Output

The class-map command itself does not produce output; it enters a configuration submode. The output shown is the CLI prompt changes. After configuration, use 'show class-map' to verify. The output of 'show class-map' lists all class maps, their match type (match-all or match-any), and the match criteria. For a class-map match-any, any single match criterion being true makes the traffic belong to that class. In a real network, you would then apply the class map in a policy map to perform QoS actions like marking, policing, or queuing.

CCNA Exam Tips

1.

Remember: 'match-any' is OR logic; 'match-all' is AND logic. Exam questions often test the difference.

2.

You can match on protocols, ACLs, DSCP values, CoS, etc. Know which match types are available.

3.

Class maps are useless without being referenced in a policy map. The exam may ask you to identify missing steps.

4.

The class-map name is case-sensitive and must be unique on the device.

Common Mistakes

Using 'match-all' when 'match-any' is needed, causing traffic that meets only one criterion to not be classified.

Forgetting to exit class-map configuration mode before creating the policy map.

Typing the class-map name incorrectly, leading to a mismatch when applying in a policy map.

Related Commands

Practice for the CCNA 200-301

Test your knowledge with hundreds of CCNA practice questions covering all exam domains.

Practice CCNA Questions