Table Of Contents
match access-group
match any
match class-map
match cos
match destination-address mac
match discard-class
match dscp
match fr-dlci
match input-interface
match ip dscp
match ip precedence
match ip rtp
match mpls experimental
match mpls experimental topmost
match not
match packet length (class-map)
match precedence
match protocol
match protocol citrix
match protocol http
match protocol rtp
match qos-group
match source-address mac
max-reserved-bandwidth
mpls experimental
match access-group
To configure the match criteria for a class map on the basis of the specified access control list (ACL), use the match access-group command in class-map configuration mode. To remove ACL match criteria from a class map, use the no form of this command.
match access-group {access-group | name access-group-name}
no match access-group access-group
Syntax Description
access-group
|
A numbered ACL whose contents are used as the match criteria against which packets are checked to determine if they belong to this class. An ACL number can be a number from 1 to 2699.
|
name access-group-name
|
A named ACL whose contents are used as the match criteria against which packets are checked to determine if they belong to this class. The name can be a maximum of 40 alphanumeric characters
|
Defaults
No match criteria are configured.
Command Modes
Class-map configuration
Command History
Release
|
Modification
|
12.0(5)T
|
This command was introduced.
|
12.0(5)XE
|
This command was integrated into Cisco IOS Release 12.0(5)XE.
|
12.0(7)S
|
This command was integrated into Cisco IOS Release 12.0(7)S.
|
12.1(1)E
|
This command was integrated into Cisco IOS Release 12.1(1)E.
|
Usage Guidelines
For class-based weighted fair queueing (CBWFQ), you define traffic classes based on match criteria including ACLs, protocols, input interfaces, QoS labels, and EXP field values. Packets satisfying the match criteria for a class constitute the traffic for that class.
The match access-group command specifies a numbered or named ACL whose contents are used as the match criteria against which packets are checked to determine if they belong to the class specified by the class map.
To use the match access-group command, you must first enter the class-map command to specify the name of the class whose match criteria you want to establish. After you identify the class, you can use one of the following commands to configure its match criteria:
•
match access-group
•
match input-interface
•
match mpls experimental
•
match protocol
If you specify more than one command in a class map, only the last command entered applies. The last command overrides the previously entered commands.
Note
The match-access group command specifies the numbered access list against whose contents packets are checked to determine if they match the criteria specified in the class map. Access lists configured with the optional log keyword of the access-list command are not supported when configuring match criteria. For more information about the access-list command, refer to the Cisco IOS IP Command Reference, Volume 1 of 4: Addressing and Services, Release 12.3 T.
Examples
The following example specifies a class map called acl144 and configures the ACL numbered 144 to be used as the match criteria for this class:
Related Commands
Command
|
Description
|
class-map
|
Creates a class map to be used for matching packets to a specified class.
|
match input-interface
|
Configures a class map to use the specified input interface as a match criterion.
|
match mpls experimental
|
Configures a class map to use the specified EXP field value as a match criterion.
|
match protocol
|
Configures the match criteria for a class map on the basis of the specified protocol.
|
match any
To configure the match criteria for a class map to be successful match criteria for all packets, use the match any command in class-map configuration mode. To remove all criteria as successful match criteria, use the no form of this command.
match any
no match any
Syntax Description
This command has no arguments or keywords.
Defaults
No match criteria are specified.
Command Modes
Class-map configuration
Command History
Release
|
Modification
|
12.0(5)XE
|
This command was introduced.
|
12.0(5)T
|
This command was integrated into Cisco IOS Release 12.0(5)T.
|
12.1(1)E
|
This command was integrated into Cisco IOS Release 12.1(1)E.
|
Examples
In the following configuration, all packets leaving Ethernet interface 1/1 will be policed based on the parameters specified in policy-map class configuration mode.
Router(config)# class-map matchany
Router(config-cmap)# match any
Router(config-cmap)# exit
Router(config)# policy-map policy1
Router(config-pmap)# class class4
Router(config-pmap-c)# police 8100 1500 2504 conform-action transmit exceed-action
set-qos-transmit 4
Router(config-pmap-c)# exit
Router(config)# interface ethernet1/1
Router(config-if)# service-policy output policy1
Related Commands
Command
|
Description
|
class-map
|
Creates a class map to be used for matching packets to a specified class.
|
match input-interface
|
Configures a class map to use the specified input interface as a match criterion.
|
match protocol
|
Configures the match criteria for a class map on the basis of the specified protocol.
|
match class-map
To use a traffic class as a classification policy, use the match class-map command in class-map configuration mode. To remove a specific traffic class as a match criterion, use the no form of this command.
match class-map class-map-name
no match class-map class-map-name
Syntax Description
class-map-name
|
Specifies the name of the traffic class to use as a match criterion.
|
Defaults
No match criteria are specified.
Command Modes
Class-map configuration
Command History
Release
|
Modification
|
12.0(5)XE
|
This command was introduced.
|
12.1(1)E
|
This command was integrated into Cisco IOS Release 12.1(1)E.
|
12.1(5)T
|
This command was integrated into Cisco IOS Release 12.1(5)T.
|
Usage Guidelines
The only method of including both match-any and match-all characteristics in a single traffic class is to use the match class-map command. To combine match-any and match-all characteristics into a single class, a traffic class created with the match-any instruction must use a class configured with the match-all instruction as a match criterion (through the match class-map command), or vice versa.
You can also use the match class-map command to nest traffic classes within one another, saving users the overhead of re-creating a new traffic class when most of the information exists in a previously configured traffic class.
Examples
In the following example, the traffic class called class1 has the same characteristics as traffic class called class2, with the exception that traffic class class1 has added a destination address as a match criterion. Rather than configuring traffic class class1 line by line, a user can enter the match class-map class2 command. This command allows all of the characteristics in the traffic class called class2 to be included in the traffic class called class1, and the user can simply add the new destination address match criterion without reconfiguring the entire traffic class.
Router(config)# class-map match-any class2
Router(config-cmap)# match protocol ip
Router(config-cmap)# match qos-group 3
Router(config-cmap)# match access-group 2
Router(config-cmap)# exit
Router(config)# class-map match-all class1
Router(config-cmap)# match class-map class2
Router(config-cmap)# match destination-address mac 1.1.1
Router(config-cmap)# exit
The following example shows how to combine the characteristics of two traffic classes, one with match-any and one with match-all characteristics, into one traffic class with the match class-map command. The result of traffic class called class4 requires a packet to match one of the following three match criteria to be considered a member of traffic class called class 4: IP protocol and QoS group 4, destination MAC address 1.1.1, or access group 2.
In this example, only the traffic class called class4 is used with the service policy called policy1.
Router(config)# class-map match-all class3
Router(config-cmap)# match protocol ip
Router(config-cmap)# match qos-group 4
Router(config-cmap)# exit
Router(config)# class-map match-any class4
Router(config-cmap)# match class-map class3
Router(config-cmap)# match destination-address mac 1.1.1
Router(config-cmap)# match access-group 2
Router(config-cmap)# exit
Router(config)# policy-map policy1
Router(config-pmap)# class class4
Router(config-pmap-c)# police 8100 1500 2504 conform-action transmit exceed-action
set-qos-transmit 4
Router(config-pmap-c)# exit
Related Commands
Command
|
Description
|
class-map
|
Creates a class map to be used for matching packets to a specified class.
|
match cos
To match a packet based on a Layer 2 class of service (CoS) marking, use the match cos command in class-map configuration mode. To remove a specific Layer 2 CoS/Inter-Switch Link (ISL) marking, use the no form of this command:
match cos cos-value [cos-value cos-value cos-value]
no match cos cos-value [cos-value cos-value cos-value]
Syntax Description
cos-value
|
(Optional) Specific IEEE 802.1Q/ISL CoS value. The cos-value is from 0 to 7; up to four CoS values can be specified in one match cos statement.
|
Defaults
No match criteria are specified.
Command Modes
Class-map configuration
Command History
Release
|
Modification
|
12.1(5)T
|
This command was introduced.
|
Examples
In the following example, the CoS-values of 1, 2, and 3 are successful match criteria for the interface containing the classification policy called cos:
Router(config)# class-map cos
Router(config-cmap)# match cos 1 2 3
In the following example, classes called voice and video-n-data are created to classify traffic based on the CoS values. QoS treatment is then given to the appropriate packets (in this case, the QoS treatment is priority 64 and bandwidth 512) in the CoS-based-treatment policy map.
Router(config)# class-map voice
Router(config-cmap)# match cos 7
Router(config)# class-map video-n-data
Router(config-cmap)# match cos 5
Router(config)# policy-map cos-based-treatment
Router(config-pmap)# class voice
Router(config-pmap-c)# priority 64
Router(config-pmap-c)# exit
Router(config-pmap)# class video-n-data
Router(config-pmap-c)# bandwidth 512
Router(config-pmap-c)# exit
Router(config-pmap)# exit
Router(config)# interface fastethernet0/0.1
Router(config-if)# service-policy output cos-based-treatment
The service policy configured in this section is attached to all packets leaving Fast Ethernet interface 0/0.1. The service policy can be attached to any interface that supports service policies.
Related Commands
Command
|
Description
|
class-map
|
Creates a class map to be used for matching packets to a specified class.
|
policy-map
|
Creates or modifies a policy map that can be attached to one or more interfaces to specify a service policy.
|
service-policy
|
Attaches a policy map to an input interface or VC, or an output interface or VC, to be used as the service policy for that interface or VC.
|
set cos
|
Sets the Layer 2 CoS value of an outgoing packet.
|
show class-map
|
Displays all class maps and their matching criteria.
|
match destination-address mac
To use the destination MAC address as a match criterion, use the match destination-address mac command in class-map configuration mode. To remove a previously specified destination MAC address as a match criterion, use the no form of this command.
match destination-address mac address
no match destination-address mac address
Syntax Description
address
|
Specifies the specific destination MAC address to be used as a match criterion.
|
Defaults
No destination MAC address is specified.
Command Modes
Class-map configuration
Command History
Release
|
Modification
|
12.0(5)XE
|
This command was introduced.
|
12.1(1)E
|
This command was integrated into Cisco IOS Release 12.1(1)E.
|
12.1(5)T
|
This command was integrated into Cisco IOS Release 12.1(5)T.
|
Examples
The following example specifies a class map called macaddress and specifies the destination MAC address to be used as the match criterion for this class:
match destination-address mac 00:00:00:00:00:00
Related Commands
Command
|
Description
|
class-map
|
Creates a class map to be used for matching packets to a specified class.
|
match discard-class
To match packets of a certain discard class, use the match discard-class command in class-map configuration mode.
match discard-class class-number
Syntax Description
class-number
|
Number of the discard class being matched. Valid values are 0 to 7.
|
Defaults
Packets will not be classified as expected.
Command Modes
Class-map configuration
Command History
Release
|
Modification
|
12.2(13)T
|
This command was introduced.
|
Examples
The following example shows that packets in discard class 2 are matched:
Related Commands
Command
|
Description
|
set discard-class
|
Marks a packet with a discard-class value.
|
match dscp
To identify a specific IP differentiated service code point (DSCP) value as a match criterion, use the match dscp command in class-map configuration mode. To remove a specific DSCP value from a class map, use the no form of this command.
match [ip] dscp dscp-value [dscp-value dscp-value dscp-value dscp-value dscp-value dscp-value
dscp-value]
no match [ip] dscp dscp-value [dscp-value dscp-value dscp-value dscp-value dscp-value
dscp-value dscp-value]
Syntax Description
ip
|
(Optional) Specifies that the match is for IPv4 packets only. If not used, the match is on both IPv4 and IPv6 packets.
|
dscp-value
|
Specifies the exact value from 0 to 63 used to identify an IP DSCP value.
|
Defaults
Matching on both IPv4 and IPv6 packets is the default.
Command Modes
Class-map configuration
Command History
Release
|
Modification
|
12.2(13)T
|
This command was introduced. This command replaces the match ip dscp command.
|
Usage Guidelines
DSCP Values
Up to eight DSCP values can be matched in one match statement. For example, if you wanted the DCSP values of 0, 1, 2, 3, 4, 5, 6, or 7 (note that only one of the IP DSCP values must be a successful match criterion, not all of the specified DSCP values), enter the match dscp 0 1 2 3 4 5 6 7 command.
This command is used by the class map to identify a specific DSCP value marking on a packet. In this context, dscp-value arguments are used as markings only and have no mathematical significance. For instance, the dscp-value of 2 is not greater than 1. The value simply indicates that a packet marked with the dscp-value of 2 is different from a packet marked with the dscp-value of 1. The treatment of these marked packets is defined by the user through the setting of QoS policies in policy-map class configuration mode.
Match IPv6 Packets on DSCP Values
To match DSCP values for IPv6 packets only, the match protocol ipv6 command must also be used. Without that command, the DSCP match defaults to match both IPv4 and IPv6 packets.
Match IPv4 Packets on DSCP Values
To match DSCP values for IPv4 packets only, use the ip keyword. Without the ip keyword, the match occurs on both IPv4 and IPv6 packets. Alternatively, the match protocol ip command can be used with the match dscp command to classify only IPv4 packets.
Examples
Priority50 Service Policy Matching DSCP Value
The following example shows how to configure the service policy called "priority50" and attach service policy "priority50" to an interface. In this example, the class map called "ipdscp15" will evaluate all packets entering interface Fast Ethernet 1/0/0 for an IP DSCP value of 15. If the incoming packet has been marked with the IP DSCP value of 15, the packet will be treated as priority traffic and will be allocated with bandwidth of 50 kbps.
Router(config)# class-map ipdscp15
Router(config-cmap)# match ip dscp 15
Router(config)# policy-map priority50
Router(config-pmap)# class ipdscp15
Router(config-pmap-c)# priority 50
Router(config-pmap-c)# exit
Router(config-pmap)# exit
Router(config)# interface fastethernet1/0/0
Router(config-if)# service-policy output priority50
Related Commands
Command
|
Description
|
class-map
|
Creates a class map to be used for matching packets to a specified class.
|
policy-map
|
Creates or modifies a policy map that can be attached to one or more interfaces to specify a service policy.
|
service-policy
|
Attaches a policy map to an input interface or VC, or an output interface or VC, to be used as the service policy for that interface or VC.
|
set dscp
|
Marks the DSCP value for packets within a traffic class.
|
show class-map
|
Displays all class maps and their matching criteria.
|
match fr-dlci
To specify the Frame Relay data-link connection identifier (DLCI) number as a match criterion in a class map, use the match fr-dlci command in class-map configuration mode. To remove a previously specified DLCI number as a match criterion, use the no form of this command.
match fr-dlci dlci-number
no match fr-dlci dlci-number
Syntax Description
dlci-number
|
Number of the DLCI associated with the packet.
|
Defaults
No DLCI number is specified.
Command Modes
Class-map configuration
Command History
Release
|
Modification
|
12.2(13)T
|
This command was introduced.
|
Usage Guidelines
This match criterion can be used in main interfaces and point-to-multipoint subinterfaces in Frame Relay networks, and it can also be used in hierarchical policy maps.
Examples
In the following example a class map called "class1" has been created and the Frame Relay DLCI number of 500 has been specified as a match criterion. Packets matching this criterion are placed in class1.
Router(config)# class-map class1
Router(config-cmap)# match fr-dlci 500
Related Commands
Command
|
Description
|
show class-map
|
Displays all class maps and their matching criteria.
|
show policy-map interface
|
Displays the packet statistics of all classes that are configured for all service policies either on the specified interface or subinterface or on a specific PVC on the interface.
|
match input-interface
To configure a class map to use the specified input interface as a match criterion, use the match input-interface command in class-map configuration mode. To remove the input interface match criterion from a class map, use the no form of this command.
match input-interface interface-name
no match input-interface interface-name
Syntax Description
interface-name
|
Name of the input interface to be used as match criteria.
|
Defaults
No match criteria are specified.
Command Modes
Class-map configuration
Command History
Release
|
Modification
|
12.0(5)T
|
This command was introduced.
|
12.0(5)XE
|
This command was integrated into Cisco IOS Release 12.0(5)XE.
|
12.0(7)S
|
This command was integrated into Cisco IOS Release 12.0(7)S.
|
12.1(1)E
|
This command was integrated into Cisco IOS Release 12.1(1)E.
|
Usage Guidelines
For class-based weighted fair queueing (CBWFQ), you define traffic classes based on match criteria including input interfaces, access control lists (ACLs), protocols, QoS labels, and EXP field values. Packets satisfying the match criteria for a class constitute the traffic for that class.
The match input-interface command specifies the name of an input interface to be used as the match criterion against which packets are checked to determine if they belong to the class specified by the class map.
To use the match input-interface command, you must first enter the class-map command to specify the name of the class whose match criteria you want to establish. After you identify the class, you can use one of the following commands to configure its match criteria:
•
match access-group
•
match input-interface
•
match mpls experimental
•
match protocol
If you specify more than one command in a class map, only the last command entered applies. The last command overrides the previously entered commands.
Examples
The following example specifies a class map called eth1 and configures the input interface named ethernet1to be used as the match criterion for this class:
match input-interface ethernet1
Related Commands
Command
|
Description
|
class-map
|
Creates a class map to be used for matching packets to a specified class.
|
match access-group
|
Configures the match criteria for a class map based on the specified ACL.
|
match mpls experimental
|
Configures a class map to use the specified EXP field value as a match criterion.
|
match protocol
|
Configures the match criteria for a class map on the basis of the specified protocol.
|
match ip dscp
The match ip dscp command is replaced by the match dscp command. See the match dscp command for more information.
match ip precedence
The match ip precedence command is replaced by the match precedence command. See the match precedence command for more information.
match ip rtp
To configure a class map to use the Real-Time Protocol (RTP) protocol port as the match criterion, use the match ip rtp command in class-map configuration mode. To remove the RTP protocol port match criterion, use the no form of this command.
match ip rtp starting-port-number port-range
no match ip rtp
Syntax Description
starting-port-number
|
The starting RTP port number. Values range from 2000 to 65535.
|
port-range
|
The RTP port number range. Values range from 0 to 16383.
|
Defaults
No match criteria are specified.
Command Modes
Class-map configuration
Command History
Release
|
Modification
|
12.1(2)T
|
This command was introduced.
|
Usage Guidelines
This command is used to match IP RTP packets that fall within the specified port range. It matches packets destined to all even User Datagram Port (UDP) port numbers in the range <starting port range> <starting port range + port range>.
Use of an RTP port range as the match criterion is particularly effective for applications that use RTP, such as voice or video.
Examples
The following example specifies a class map called eth1 and configures the RTP port number 2024 and range 1000 to be used as the match criteria for this class:
Related Commands
Command
|
Description
|
ip rtp priority
|
Reserves a strict priority queue for a set of RTP packet flows belonging to a range of UDP destination ports.
|
match access-group
|
Configures the match criteria for a class map based on the specified ACL number.
|
match mpls experimental
To configure a class map to use the specified value of the experimental (EXP) field as a match criterion, use the match mpls experimental command in class-map configuration mode. To remove the EXP field match criterion from a class map, use the no form of this command.
match mpls experimental number
no match mpls experimental number
Syntax Description
number
|
EXP field value (any number from 0 through 7) to be used as a match criterion. Numbers can be space delimited (for example, 3 4 7).
|
Defaults
No match criteria are specified.
Command Modes
Class-map configuration
Command History
Release
|
Modification
|
12.0(7)XE1
|
This command was introduced.
|
12.1(1)E
|
This command was integrated into Cisco IOS Release 12.1(1)E.
|
12.1(5)T
|
This command was integrated into Cisco IOS Release 12.1(5)T.
|
12.2(4)T
|
This command was implemented on the Cisco MGX 8850 switch and the MGX 8950 switch with a Cisco MGX RPM-PR card.
|
12.2(4)T2
|
This command was implemented on the Cisco 7500 series.
|
Usage Guidelines
For class-based weighted fair queueing (CBWFQ), you define traffic classes based on match criteria including input interfaces, access control lists (ACLs), protocols, quality of service (QoS) labels, and EXP field values. Packets satisfying the match criteria for a class constitute the traffic for that class.
The match mpls experimental command specifies the name of an EXP field value to be used as the match criterion against which packets are checked to determine if they belong to the class specified by the class map.
To use the match mpls experimental command, you must first enter the class-map command to specify the name of the class whose match criteria you want to establish. After you identify the class, you can use one of the following commands to configure its match criteria:
•
match access-group
•
match input-interface
•
match mpls experimental
•
match protocol
If you specify more than one command in a class map, only the last command entered applies. The last command overrides the previously entered commands.
Examples
The following example specifies a class map called eth1 and configures the Multiprotocol Label Switching (MPLS) experimental values of 1 and 2 to be used as the match criterion for this class:
Router(config)# class-map ethernet1
Router(config-cmap)# match mpls experimental 1 2
Related Commands
Command
|
Description
|
class-map
|
Creates a class map to be used for matching packets to a specified class.
|
match access-group
|
Configures the match criteria for a class map based on the specified ACL.
|
match input-interface
|
Configures a class map to use the specified input interface as a match criterion.
|
match protocol
|
Matches traffic by a particular protocol.
|
match qos-group
|
Configures the match criteria for a class map based on the specified protocol.
|
match mpls experimental topmost
To match the experimental (EXP) value in the topmost label, use the match mpls experimental topmost command in class-map configuration mode.
match mpls experimental topmost value
Syntax Description
value
|
Value of the Multiprotocol Label Switching (MPLS) EXP field in the topmost label header. Valid values are 0 to 7.
|
Defaults
Packets will not be classified as expected.
Command Modes
Class-map configuration
Command History
Release
|
Modification
|
12.2(13)T
|
This command was introduced.
|
Usage Guidelines
You can enter this command on the input and the output interfaces. It will match only on MPLS packets.
Examples
The following example shows that the EXP value 3 in the topmost label is matched:
match mpls experimental topmost 3
Related Commands
Command
|
Description
|
set mpls experimental topmost
|
Sets the MPLS EXP field value in the topmost MPLS label header at the input and/or output interfaces.
|
match not
To specify the single match criterion value to use as an unsuccessful match criterion, use the match not command in class-map configuration mode. To remove a previously specified source value to not use as a match criterion, use the no form of this command.
match not match-criteria
no match not match-criteria
Syntax Description
match-criteria
|
Specifies the match criterion value that is an unsuccessful match criterion. All other values of the specified match criterion will be considered successful match criteria.
|
Defaults
No default behavior or values
Command Modes
Class-map configuration
Command History
Release
|
Modification
|
12.0(5)XE
|
This command was introduced.
|
12.0(5)T
|
This command was integrated into Cisco IOS Release 12.0(5)T.
|
12.1(1)E
|
This command was integrated into Cisco IOS Release 12.1(1)E.
|
Usage Guidelines
The match not command is used to specify a QoS policy value that is not used as a match criterion. When the match not command is used, all other values of that QoS policy become successful match criteria.
For instance, if the match not qos-group 4 command is issued in class-map configuration mode, the specified class will accept all QoS group values except 4 as successful match criteria.
Examples
In the following traffic class, all protocols except IP are considered successful match criteria:
Router(config)# class-map noip
Router(config-cmap)# match not protocol ip
Router(config-cmap)# exit
Related Commands
Command
|
Description
|
class-map
|
Creates a class map to be used for matching packets to a specified class.
|
match packet length (class-map)
To specify the Layer 3 packet length in the IP header as a match criterion in a class map, use the match packet length command in class-map configuration mode. To remove a previously specified Layer 3 packet length as a match criterion, use the no form of this command.
match packet length {max maximum-length-value [min minimum-length-value] | min
minimum-length-value [max maximum-length-value]}
no match packet length {max maximum-length-value [min minimum-length-value] | min
minimum-length-value [max maximum-length-value]}
Syntax Description
max
|
Maximum. Indicates that a maximum value for the Layer 3 packet length is to be specified.
|
maximum-length-value
|
Specifies the maximum length value of the Layer 3 packet length, in bytes. The range is from 1 to 2000.
|
min
|
Minimum. Indicates that a minimum value for the Layer 3 packet length is to be specified.
|
minimum-length-value
|
Specifies the minimum length value of the Layer 3 packet length, in bytes. The range is from 1 to 2000.
|
Defaults
If only the minimum value is specified, a packet with a Layer 3 length greater than the minimum is viewed as matching the criterion.
If only the maximum value is specified, a packet with a Layer 3 length less than the maximum is viewed as matching the criterion.
Command Modes
Class-map configuration
Command History
Release
|
Modification
|
12.2(13)T
|
This command was introduced.
|
Usage Guidelines
This command considers only the Layer 3 packet length in the IP header. It does not consider the Layer 2 packet length in the IP header.
When using this command, you must at least specify the maximum or minimum value. However, you do have the option of entering both values.
Examples
In the following example a class map called "class 1" has been created, and the Layer 3 packet length has been specified as a match criterion. In this example, packets with a minimum Layer 3 packet length of 100 and a maximum Layer 3 packet length of 300 are viewed as meeting the match criteria.
Router(config)# class map match-all class1
Router(config-cmap)# match packet length min 100 max 300
Related Commands
Command
|
Description
|
show class-map
|
Displays all class maps and their matching criteria.
|
show policy-map interface
|
Displays the packet statistics of all classes that are configured for all service policies either on the specified interface or subinterface or on a specific PVC on the interface.
|
match precedence
To identify IP precedence values as match criteria, use the match precedence command in class-map configuration mode. To remove IP precedence values from a class map, use the no form of this command.
match [ip] precedence precedence-value [precedence-value precedence-value precedence-value]
no match [ip] precedence precedence value [precedence-value precedence-value
precedence-value]
Syntax Description
ip
|
(Optional) Specifies that the match is for IPv4 packets only. If not used, the match is on both the IPv4 and IPv6 packets.
|
precedence-value
|
Specifies the exact value from 0 to 7 used to identify a precedence value.
|
Defaults
Matching on both IPv4 and IPv6 packets is the default.
Command Modes
Class-map configuration
Command History
Release
|
Modification
|
12.2(13)T
|
This command was introduced.
|
Usage Guidelines
Precedence Value Arguments
Up to four precedence values can be matched in one match statement. For example, if you wanted the precedence values of 0, 1, 2, or 3 (note that only one of the precedence values must be a successful match criterion, not all of the specified precedence values), enter the match ip precedence 0 1 2 3 command.
The precedence-value arguments are used as markings only. In this context, the IP precedence values have no mathematical significance. For instance, the precedence-value of 2 is not greater than 1. The value simply indicates that a packet marked with the precedence-value of 2 is different from a packet marked with the precedence-value of 1. The treatment of these different packets is defined by the user through the setting of QoS policies in policy-map class configuration mode.
Match on Precedence for IPv6 Only
To match on precedence values for IPv6 packets only, the match protocol ipv6 command must also be used. Without that command, the precedence match defaults to match both IPv4 and IPv6 packets.
Match on Precedence for IPv4 Packets Only
To match on precedence values for IPv4 packets only, use the ip keyword. Without the ip keyword, the match occurs on both IPv4 and IPv6 packets.
Examples
IPv4-Specific Traffic Match
The following example shows how to configure the service policy called "priority50" and attach service policy "priority50" to an interface, matching for IPv4 traffic only. In a network where both IPv4 and IPv6 are running, you might find it necessary to distinguish between the protocols for matching and traffic segregation. In this example, the class map called "ipprec5" will evaluate all IPv4 packets entering Fast Ethernet interface 1/0/0 for a precedence value of 5. If the incoming IPv4 packet has been marked with the precedence value of 5, the packet will be treated as priority traffic and will be allocated with bandwidth of 50 kbps.
Router(config)# class-map ipprec5
Router(config-cmap)# match ip precedence 5
Router(config)# policy-map priority50
Router(config-pmap)# class ipprec5
Router(config-pmap-c)# priority 50
Router(config-pmap-c)# exit
Router(config-pmap)# exit
Router(config)# interface fastethernet1/0/0
Router(config-if)# service-policy input priority50
IPv6-Specific Traffic Match
The following example shows the same service policy matching on precedence for IPv6 traffic only. Notice that the match protocol command with the ipv6 keyword precedes the match precedence command. The match protocol command is required to perform matches on IPv6 traffic alone.
Router(config)# class-map ipprec5
Router(config-cmap)# match protocol ipv6
Router(config-cmap)# match precedence 5
Router(config)# policy-map priority50
Router(config-pmap)# class ipprec5
Router(config-pmap-c)# priority 50
Router(config-pmap-c)# exit
Router(config-pmap)# exit
Router(config)# interface fastethernet1/0/0
Router(config-if)# service-policy input priority50
Related Commands
Command
|
Description
|
class-map
|
Creates a class map to be used for matching packets to a specified class.
|
policy-map
|
Creates or modifies a policy map that can be attached to one or more interfaces to specify a service policy.
|
service-policy
|
Attaches a policy map to an input interface or VC, or an output interface or VC, to be used as the service policy for that interface or VC.
|
set ip precedence
|
Sets the precedence value in the IP header.
|
show class-map
|
Displays all class maps and their matching criteria, or a specified class map and its matching criteria.
|
match protocol
To configure the match criteria for a class map on the basis of the specified protocol, use the match protocol command in class-map configuration mode. To remove protocol-based match criteria from a class map, use the no form of this command.
match protocol protocol-name
no match protocol protocol-name
Syntax Description
protocol-name
|
Name of the protocol used as a matching criterion. Supported protocols include the following:
• aarp—AppleTalk Address Resolution Protocol
• arp—IP Address Resolution Protocol (ARP)
• bridge—bridging
• bstun—Block Serial Tunneling
• cdp—Cisco Discovery Protocol
• clns—ISO Connectionless Network Service
• clns_es—ISO CLNS End System
• clns_is—ISO CLNS Intermediate System
• cmns—ISO Connection-Mode Network Service
• compressedtcp—compressed TCP
• decnet—DECnet
• decnet_node—DECnet Node
• decnet_router-I1—DECnet Router L1
• decnet_router-I2—DECnet Router L2
• dlsw—data-link switching
• ip—IP
• ipv6—IPv6
• ipx—Novell IPX
• llc2—llc2
• pad—packet assembler/disassembler links
• qllc—Qualified Logical Link Control protocol
• rsrb—remote source-route bridging
• snapshot—snapshot routing support
• stun—serial tunnel
|
Defaults
No default behavior or values
Command Modes
Class-map configuration
Command History
Release
|
Modification
|
12.0(5)T
|
This command was introduced.
|
12.0(5)XE
|
This command was integrated into Cisco IOS Release 12.0(5)XE.
|
12.0(7)S
|
This command was integrated into Cisco IOS Release 12.0(7)S.
|
12.1(1)E
|
This command was integrated into Cisco IOS Release 12.1(1)E.
|
12.1(13)E
|
This command was implemented on Catalyst 6000 family switches without FlexWAN modules.
|
12.2(8)T
|
This command was integrated into Cisco IOS Release 12.2(8)T.
|
12.2(13)T
|
This command was modified to remove apollo, vines, and xns from the list of protocols used as matching criteria. These protocols were removed because Apollo Domain, Banyan VINES, and Xerox Network Systems (XNS) were removed in Release 12.2(13)T.
In addition, the ipv6 keyword was added to support protocol matching on IPv6 packets.
|
Usage Guidelines
For class-based weighted fair queueing (CBWFQ), you define traffic classes based on match criteria including protocols, access control lists (ACLs), input interfaces, QoS labels, and EXP field values. Packets satisfying the match criteria for a class constitute the traffic for that class.
The match protocol command specifies the name of a protocol to be used as the match criteria against which packets are checked to determine if they belong to the class specified by the class map.
To use the match protocol command, you must first enter the class-map command to specify the name of the class whose match criteria you want to establish. After you identify the class, you can use one of the following commands to configure its match criteria:
•
match access-group
•
match input-interface
•
match mpls experimental
•
match protocol
If you specify more than one command in a class map, only the last command entered applies. The last command overrides the previously entered commands.
This command can be used to match protocols that are known to the network-based application recognition (NBAR) feature. For a list of protocols currently supported by NBAR, refer to the "Classification" section of the Cisco IOS Quality of Service Solutions Configuration Guide.
Examples
The following example specifies a class map called ipx and configures the Internetwork Packet Exchange (IPX) protocol as a match criterion for it:
The following example configures NBAR to match FTP traffic:
Related Commands
Command
|
Description
|
class-map
|
Creates a class map to be used for matching packets to a specified class.
|
match access-group
|
Configures the match criteria for a class map based on the specified ACL.
|
|