This is going to be loooong... OK I try this step by step and as easy as possible:
1) Define your traffic match characteristics, or class maps. You can use only one match command per class-map:
Router(config)# class-map CMAP-NAME
! match packets based on access-list number:
Router(config-cmap)# match access-group ACL-NUMBER
! or match packets based on incoming interface
Router(config-cmap)# match input-interface
! or match packets based on layer-3 protocol name
Router(config-cmap)# match protocol PROTOCOL
! or match based on IP DSCP value
Router(config-cmap)# match ip precedence TOS-VALUE
2) Now associate your match criteria, that is class-map, with a policy to create policy maps:
Router(config)# policy-map PMAP-NAME
Router(config-pmap)# class CMAP-NAME
2.1) You now policy your class maps. You can use:
give the matched traffic a percentage of bandwidth:
Router(config-pmap-c)# bandwidth BW-IN-KBPS | percent %%%
if router is expecting congestion, you can have packets from your class-map to be dropped according to more intelligent WRED, than tail-drop (normal operation), however WRED is usable oly with TCP traffic, which can recover from lost segments:
Router(config-pmap-c)# random-detect
you can specify how much packets a class-map' queue can hold at any time using (default is 64):
Router(config-pmap-c)# queue-limit NUMBER-OF-PACKETS
to configure LLQ (bandwidth, queue-limit and random-detect cannot be used with priority class-map) use:
Router(config-pmap-c)# priority BANDWIDTH-IN-KBPS
3) Finally you have to apply your config to interface:
Router(config)# interface TYPE NUMBER
Router(config-if)# service-policy input|output PMAP-NAME
And here you have LLQ example:
In this example, the class map called “IPPREC5” will evaluate all IPv4 packets entering FastEthernet interface 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)# exit
Router(config)# policy-map PRIO-50
Router(config-pmap)# class IPPREC5
Router(config-pmap-c)# priority 50
Router(config-pmap-c)# exit
Router(config-pmap)# exit
Router(config)# interface fa0/0
Router(config-if)# service-policy input PRIO-50
Another example from Cisco guide:
In the following example, three policy maps are defined:
cust1-classes
cust2-classes
cust-policy
Policy map cust1-classes have defined:
gold - use 50% of bandwidth
silver - use 20% of bandwidth
bronze - use 15% of bandwidth
Policy map cust2-classes have defined:
gold - use 30% of bandwidth
silver - use 15% of bandwidth
bronze - use 10% of bandwidth
The policy map cust-policy specifies average rate shaping of 384 kbps and assigns the service policy
called cust1-classes to the policy map called cust1-classes. The policy map called cust-policy specifies
peak rate shaping of 512 kbps and assigns the service policy called cust2-classes to the policy map called
cust2-classes.
To configure classes for cust1-classes, use the following commands:
Router(config)# policy-map cust1-classes
Router(config-pmap)# class gold
Router(config-pmap-c)# bandwidth percent 50
Router(config-pmap-c)# exit
Router(config-pmap)# class silver
Router(config-pmap-c)# bandwidth percent 20
Router(config-pmap-c)# exit
Router(config-pmap)# class bronze
Router(config-pmap-c)# bandwidth percent 15
To configure classes for cust2, use the following commands:
Router(config)# policy-map cust2-classes
Router(config-pmap)# class gold
Router(config-pmap-c)# bandwidth percent 30
Router(config-pmap-c)# exit
Router(config-pmap)# class silver
Router(config-pmap-c)# bandwidth percent 15
Router(config-pmap-c)# exit
Router(config-pmap)# class bronze
Router(config-pmap-c)# bandwidth percent 10
To define the customer policy with cust1-classes and cust2-classes and QoS features, use the following
commands:
Router(config)# policy-map cust-policy
Router(config-pmap)# class cust1
Router(config-pmap-c)# shape average 38400
Router(config-pmap-c)# service-policy cust1-classes
Router(config-pmap-c)# exit
Router(config-pmap)# class cust2
Router(config-pmap-c)# shape peak 51200
Router(config-pmap-c)# service-policy cust2-classes
Router(config-pmap-c)# exit
Router(config-pmap)# exit
Router(config)# exit
Router(config)# interface serial0/0
Router(config-if)# service out cust-policy
Hope this helps
Peter Mesjar
CCNP, A+ certified
pmesjar@centrum.sk
"The only true wisdom is in knowing you know nothing.