Use these M4500 CLI commands to create DiffServ class maps and define match criteria such as CoS, DSCP, IP precedence, addresses, ports, and protocols.
The 'class' command set is used in DiffServ to define:
Traffic Classification specifies Behavior Aggregate (BA) based on DSCP, and Multi- Field (MF) classes of traffic (name, match criteria)
Service Levels specifies the BA forwarding classes / service levels. Conceptually, DiffServ is a two-level hierarchy of classes: 1. Service/PHB, 2. Traffic Class
This set of commands consists of class creation/deletion and matching, with the class match commands specifying layer 3, layer 2, and general match criteria. The class match criteria are also known as class rules, with a class definition consisting of one or more rules to identify the traffic belonging to the class. Note that once a class match criterion is created for a class, it cannot be changed or deleted - the entire class must be deleted and re-created.
The CLI command root is class-map.
class-map
This command defines a new DiffServ class of type match-all, match-any or match-access-group.
When used without any match condition, this command enters the class-map mode. The <class-map-name> is the name of an existing DiffServ class.
!
The class name 'default' is reserved and is not allowed here. The class type of match-all indicates all of the
individual match conditions must be true for a packet to be considered a member of the class.
The optional keywords [{ipv4 | ipv6}] specify the Layer 3 protocol for this class. If not specified, this parameter defaults to ‘ipv4’. This maintains backward compatibility for configurations defined on systems before IPv6 match items were supported.
The CLI mode is changed to Class-Map Config or Ipv6-Class-Map Config when this command is successfully executed depending on the [{ipv4 | ipv6}] keyword specified.
no class-map
This command eliminates an existing DiffServ class.
!
The class name 'default' is reserved and is not allowed here. This command may be issued at any time; if
the class is currently referenced by one or more policies or by any other class, this deletion attempt shall fail.
rename
This command changes the name of a DiffServ class.
!
The class name ‘default’ is reserved and must not be used here.
match any
This command adds to the specified class definition a match condition whereby all packets are considered to belong to the class.
match class-map
This command adds to the specified class definition the set of match conditions defined for another class.
Note: There is no [not] option for this match command.
Restrictions
The class types of both <classname> and <refclassname> must be identical (that is, any vs. any, or all vs. all). A class type of acl is not supported by this command.
Cannot specify <refclassname> the same as <classname> (that is, self-referencing of class name not allowed). At most one other class may be referenced by a class. Any attempt to delete the <refclassname> class while still referenced by any <classname> shall fail.
The combined match criteria of <classname> and <refclassname> must be an allowed combination based on the class type. Any subsequent changes to the <refclassname> class match criteria must maintain this validity, or the change attempt shall fail. The total number of class rules formed by the complete reference class chain (includes both predecessor and successor classes) must not exceed a platform-specific maximum. In some cases, each removal of a refclass rule reduces the maximum number of available rules in the class definition by one.
no match class-map
This command removes from the specified class definition the set of match conditions defined for another class.
Note: There is no [not] option for this match command.
match cos
This command adds to the specified class definition a match condition for the Class of Service value (the only tag in a single tagged packet or the first or outer 802.1Q tag of a double VLAN tagged packet). The value may be from 0 to 7.
match secondary-cos
This command adds to the specified class definition a match condition for the secondary Class of Service value (the inner 802.1Q tag of a double VLAN tagged packet). The value may be from 0 to 7.
match destination-address mac
This command adds to the specified class definition a match condition based on the destination MAC address of a packet. The <address> parameter is any layer 2 MAC address formatted as six, two-digit hexadecimal numbers separated by colons (e.g., 00:11:22:dd:ee:ff). The <mac-mask> parameter is a layer 2 MAC address bit mask, which need not be contiguous, and is formatted as six, two-digit hexadecimal numbers separated by colons (e.g., ff:07:23:ff:fe:dc).
match dstip
This command adds to the specified class definition a match condition based on the destination IP address of a packet.
match dstI4port
This command adds to the specified class definition a match condition based on the destination layer 4 port of a packet using a single keyword or numeric notation or a numeric range notation.
match ethertype
This command adds to the specified class definition a match condition based on the value of the ethertype. The <ethertype> value is specified as one of the following keywords: appletalk, arp, ibmsna, ipv4, ipv6, ipx, mplsmcast, mplsucast, netbios, novell, pppoe, rarp or as a custom ethertype value in the range of 0x0600-0xFFFF.
match ip dscp
This command adds to the specified class definition a match condition based on the value of the IP DiffServ Code Point (DSCP) field in a packet, which is defined as the high-order six bits of the Service Type octet in the IP header (the low-order two bits are not checked).
Note: The ip dscp, ip precedence, and ip tos match conditions are alternative ways to specify a match criterion for the same Service Type field in the IP header, but with a slightly different user notation. To specify a match on all DSCP values, use the match [not] ip tos <tosbits> <tosmask> command with <tosbits> set to 0 and <tosmask> set to 03 (hex).
match ip precedence
This command adds to the specified class definition a match condition based on the value of the IP Precedence field in a packet, which is defined as the high-order three bits of the Service Type octet in the IP header (the low-order five bits are not checked). The precedence value is an integer from 0 to 7.
Note: The ip dscp, ip precedence, and ip tos match conditions are alternative ways to specify a match criterion for the same Service Type field in the IP header, but with a slightly different user notation.
To specify a match on all Precedence values, use the match [not] ip tos <tosbits> <tosmask> command with <tosbits> set to 0 and <tosmask> set to 1F (hex).
match ip tos
This command adds to the specified class definition a match condition based on the value of the IP TOS field in a packet, which is defined as all eight bits of the Service Type octet in the IP header.
Note: The ip dscp, ip precedence, and ip tos match conditions are alternative ways to specify a match criterion for the same Service Type field in the IP header, but with a slightly different user notation.
In essence, this the “free form” version of the IP DSCP/Precedence/TOS match specification in that the user has complete control of specifying which bits of the IP Service Type field are checked.Default None
match protocol
This command adds to the specified class definition a match condition based on the value of the IP Protocol field in a packet using a single keyword notation or a numeric value notation.
Note: This command does not validate the protocol number value against the current list defined by IANA.Default None
match source-address mac
This command adds to the specified class definition a match condition based on the source MAC address of a packet. The <address> parameter is any layer 2 MAC address formatted as six, two-digit hexadecimal numbers separated by colons (e.g., 00:11:22:dd:ee:ff). The <macmask> parameter is a layer 2 MAC address bit mask, which may not be contiguous, and is formatted as six, two-digit hexadecimal numbers separated by colons (e.g., ff:07:23:ff:fe:dc).
match scrip
This command adds to the specified class definition a match condition based on the source IP address of a packet.
match srcI4port
This command adds to the specified class definition a match condition based on the source layer 4 port of a packet using a single keyword or numeric notation or a numeric range notation.
match vlan
This command adds to the specified class definition a match condition based on the value of the layer 2 VLAN Identifier field (the only tag in a single tagged packet or the first or outer tag of a double VLAN tagged packet). The VLAN ID is an integer from 1 to 4093.
match secondary-vlan
This command adds to the specified class definition a match condition based on the value of the layer 2 secondary VLAN Identifier field (the inner 802.1Q tag of a double VLAN tagged packet). The VLAN ID is an integer from 1 to 4093.
match dstipv6
This command adds to the specified class definition a match condition based on the destination IPv6 address of a packet.
match srcipv6
This command adds to the specified class definition a match condition based on the source IP address of a packet.
match ip6flowlbl
This command adds to the specified class definition a match condition based on the IPv6 flow label value.