show class-map
Displays the configuration and match criteria of all class maps or a specific class map, used to verify QoS classification rules.
show class-mapWhen to Use This Command
- Verify that a class map matches the intended traffic (e.g., HTTP traffic) after configuration.
- Troubleshoot why QoS policies are not classifying traffic correctly.
- Audit existing class maps before modifying or deleting them.
- Check the match type (match-all vs match-any) and match criteria for a specific class map.
Command Examples
Display all class maps
show class-mapClass Map match-any HTTP_TRAFFIC (id 1) Match protocol http Class Map match-all VOICE_TRAFFIC (id 2) Match ip dscp ef Class Map match-all CRITICAL_DATA (id 3) Match access-group name CRITICAL_ACL
Line 1: Class map name 'HTTP_TRAFFIC' with match-any logic (matches if any condition is true), internal ID 1. Line 2: Match condition - protocol http. Line 3: Class map 'VOICE_TRAFFIC' with match-all logic (all conditions must match), ID 2. Line 4: Match condition - IP DSCP value EF. Line 5: Class map 'CRITICAL_DATA' with match-all logic, ID 3. Line 6: Match condition - named access-list CRITICAL_ACL.
Display a specific class map
show class-map VOICE_TRAFFICClass Map match-all VOICE_TRAFFIC (id 2) Match ip dscp ef
Shows only the class map named VOICE_TRAFFIC. The output confirms it uses match-all logic and matches on DSCP EF (Expedited Forwarding).
Understanding the Output
The output lists each class map with its name, match type (match-all or match-any), and internal ID. Below the header, each match condition is shown. 'Match-all' means all conditions must be true for a packet to match; 'match-any' means any one condition is sufficient. The match criteria can include protocol, DSCP, IP precedence, access-group, CoS, etc. In a real network, verify that the class maps are correctly defined before applying them in a policy map. A missing or incorrect class map can cause traffic to be misclassified, leading to QoS policies not working as intended.
CCNA Exam Tips
CCNA exam tip: Remember that 'match-all' is the default if not specified; 'match-any' must be explicitly configured.
CCNA exam tip: Class maps are used in policy maps to define traffic classes; know the difference between class maps and policy maps.
CCNA exam tip: The 'show class-map' command does not show which policy maps reference the class map; use 'show policy-map' for that.
CCNA exam tip: You can match on multiple criteria; for example, match-all with both DSCP and access-group requires both to match.
Common Mistakes
Mistake: Forgetting to specify match-any when multiple match criteria should be ORed; default is match-all which ANDs them.
Mistake: Using 'match protocol http' without ensuring NBAR is enabled; otherwise the match may not work.
Mistake: Deleting a class map that is referenced by a policy map, causing the policy to fail.
Related Commands
show policy-map
Displays the configuration and statistics of all policy maps applied to interfaces, used to verify QoS policies and monitor traffic class counters.
show policy-map interface
Displays the current QoS policy applied to an interface, including per-class statistics such as packets matched, bytes, and actions taken, used to verify and troubleshoot QoS configurations.
Practice for the CCNA 200-301
Test your knowledge with hundreds of CCNA practice questions covering all exam domains.
Practice CCNA Questions