Configuring CBQoS on a Cisco device

To configure class-based QoS (CBQoS) on a Cisco device, perform the following tasks:

Note: The following procedures illustrate how to create a traffic class, how to create a traffic policy and how to attach the policy to an interface. The specific commands used to illustrate how these steps may be accomplished on a Cisco router are only for the purposes of this example. For more detailed information on how to implement QoS for your network, see Creating a Traffic Policy in the Cisco IOS Quality of Service Solutions Configuration Guide.

To create a traffic class:

  1. Enable the privileged EXEC mode and enter the global configuration mode.

    Router> enable

    Router# configure terminal

  2. Create the class name and enter the configure class map mode.

    Router(config)# class-map match-any NMclass

    Note: The match-any keyword is used when all of the match criteria in the traffic class must be met in order for a packet to be placed in the specified traffic class.

  3. Use one or more match commands to specify the match criteria. Packets that match the specified match criteria will be placed in the traffic class.

    Router(config-cmap)# match protocol snmp

    Router(config-cmap)# match protocol icmp

    Note: You can repeat the steps that create a class name and specify the match criteria to create as many classes as are needed to define the policy you want to apply to the interface.

  4. Exit the class map configuration mode.

    Router(config-cmap)# exit

Example: Class Map configuration

The following is an example of a class map configuration.

class-map match-any nm

match protocol snmp

match protocol icmp

class-map match-any p2p

match protocol kazaa2

match protocol gnutella

match protocol edonkey

match protocol bittorrent

match protocol fasttrack

match protocol directconnect

match protocol winmx

class-map match-all FTP

match protocol ftp

class-map match-any web

match protocol http

class-map match-any utube

match protocol http s-header-box "*http://www.youtube.com/*"

To create a traffic policy:

  1. Enable the privileged EXEC mode and enter the global configuration mode (config).

    Router> enable

    Router# configure terminal

  2. Create the traffic policy and enter the policy-map configuration mode (config-pmap).

    Router(config)# policy-map newPolicy

  3. Specify the name of the class to associate with the policy and enter the policy-map class configuration mode (config-pmap-c).

    Note: In the policy-map class configuration mode you can define one or more QoS features which supply services supporting dedicated bandwidth, improving loss characteristics, managing network congestion, traffic shaping and setting traffic priorities. For more information see Creating a Traffic Policy in the Cisco IOS Quality of Service Solutions Configuration Guide.

    Router(config-pmap)# class NMclass

  4. In the policy-map class configuration mode define the QoS features you want to apply to the class.

    Router(config-pmap-c)# drop

    Note: You can repeat the steps associating a class with the policy and defining the QoS features to apply to the class as many times as is necessary to create a policy that establishes services for all of the defined classes.

  5. Exit the policy-map class configuration mode.

    Router(config-pmap-c)# exit

Example: Traffic policy

The following is an example of a traffic policy:

policy-map crTest2

class p2p

drop

class FTP

drop

class nm

set dscp af43

class web

set dscp af12

class utube

set dscp af43

To associate a policy with an interface:

  1. Enable the privileged EXEC mode and enter the global configuration mode (config).

    Router> enable

    Router# configure terminal

  2. Select the interface to configure and enter the interface configuration mode.

    Router(config)# interface GigabitEthernet0/0

  3. Attach the policy map to the interface.

    Router(config-if)# service-policy output input newPolicy

  4. Exit the interface configuration mode.

    Router(config-if)# exit

    Note: For more information on associating a policy with an interface, see Attaching a Traffic policy to an Interface in the Cisco IOS Quality of Service Solutions Configuration Guide.

See Also

About CBQoS