Pcornel
Networking · IP Services › QoS

Class Map

Cheat sheet · https://pcornel.dk/topic.php?topic=668

Back to the Topic

Answer

A class-map defines which traffic belongs to a class, using match criteria such as DSCP, ACL, protocol (NBAR) or CoS, with match-any or match-all logic.

Remember

  • A class map defines which traffic belongs to a class using match statements.
  • match-any needs one match; match-all needs all.
  • Unmatched traffic falls into class-default.

First checks

  • show class-map — class definitions
  • show policy-map interface <interface> — packets matched per class

Commands

class-map match-any <name>
Create a class map that matches traffic if any match statement is true.
class-map match-all <name>
Create a class map that matches traffic only if all match statements are true.
match access-group name <acl>
Match traffic in a class map using a named ACL.
match dscp <value>
Match traffic in a class map by DSCP value.
match cos <value>
Match traffic in a class map by 802.1p CoS value.
show policy-map interface
Display per-class QoS counters on interfaces.
show class-map

Verify in this order

traffic → class-map match → class

Where it usually breaks

packet selector → class match → marking → policy attachment → queue/policer/shaper → egress counters/drops → receiver behavior

Class Map · technical reference

LayerQuestion
Class mapWhich packets match?
Policy mapWhat action applies?
Service policyWhere/direction is it active?
CountersDid real traffic hit the class?

Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=668

Confirmation

Confirm action

Continue?