Choose the Interesting Traffic
Router(config-cmap)# match access-group name LETWEBIN | Selects traffic by access control list (ACL) name or number. |
Router(config-cmap)# match cos 1 2 3 | Selects traffic by one or more Layer 2 class of service (CoS) value(s). |
Router(config-cmap)# match source-address mac 00:00:00:00:00:00 | Selects traffic by source MAC address. |
Router(config-cmap)# match destination-address mac 00:00:00:00:00:00 | Selects traffic by destination Media Access Control (MAC) address. |
Router(config-cmap)# match discard-class 2 | Selects traffic marked by the set discard-class value command. |
Router(config-cmap)# match dscp 1 2 af11 | Selects traffic by one or more differentiated services code point (DSCP) value(s). |
Router(config-cmap)# match fr-de | Selects traffic by a set discard eligible bit. |
Router(config-cmap)# match fr-dlci 416 | Selects traffic by Frame Relay data-link connection identifier (DLCI) number. |
Router(config-cmap)# match input-interface serial0/0/0 | Selects traffic by input interface name. |
Router(config-cmap)# match vlan 55-59 82 | Selects traffic in a single VLAN, a range of VLANs, or both. |
Router(config-cmap)# match qos-group 3 | Selects traffic marked by the set qos-group value command. |
| NOTE: Use NBAR for classification by using the match protocol protocol-name command. |
Router(config-cmap)# match protocol bgp | Selects traffic by NBAR protocol discovery. |
Router(config-cmap)# match class-map CLASSMAPNAME | Selects traffic by nesting a class-map in a class-map. |
| NOTE: Traffic classes can be nested 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. In the previous example, traffic class CLASSMAPNAME could have the same characteristics of another class-map with the exception of a single line. Rather than reconfigure the class-map line for line, you can nest one class-map inside another class-map. |
Router(config-cmap)# exit | Exit class-map configuration mode. |
The tasks to mark traffic are
STEP 3. | |
STEP 4. | |
STEP 5. | |
STEP 6. | |
Step 3: Create a Policy
Router(config)# policy-map MARKINGPOLICY | Creates the marking policy MARKINGPOLICY. |
Step 4: Choose the Class of Traffic
Router(config-pmap)# class MAPNAME | Chooses the class to use in this policy. |
Step 5: Mark the Traffic in the Class
Router(config-pmap-c)# set dscp af41 | Sets the DSCP of the traffic class MAPNAME to "af41". |
Router(config-pmap-c)# exit | Exits out of config-pmac-c mode and returns to config-pmap mode. |
Note
Repeat steps 4 and 5 until all required classes are defined.
Step 4 (repeated): Choose the Class of Traffic
Router(config-pmap)# class CLASSMAPNAME | Add another class of traffic to policy MARKINGPOLICY. |
Step 5 (repeated): Mark the Traffic in the Class
Router(config-pmap)# set cos 3 | Marks the packets in class MYMAPCLASS with a CoS value of 3. |
Router(config-pmap-c)# set precedence 5 | Marks the packets in class MYMAPCLASS with a precedence value of 5. |
Router(config-pmap-c)# set qos-group 4 | Sets a group identifier that is used to classify packets. |
Router(config-pmap-c)# exit | Finishes defining the policy for class MYMAPNAME. |
Step 6: Apply the Policy to an Interface
Router(config)# interface serial 0/0/0 | Chooses which interface to set the marking policy. |
Router(config-if)# service-policy output MARKINGPOLICY | Applies the marking policy to outbound traffic. |