Bandwidth Configuration
This chapter contains a complete sample of configuring Bandwidth.
Topology
Simple configuration of Bandwidth
L2/L3 Interface
The following steps describe how to configure bandwidth.
#configure terminal | Enter configure mode. |
(config)#qos enable | Enable QoS globally. |
(config)#qos statistics | Enable QoS statistics. |
(config)#policy-map type queuing default P1 | Configure policy-map of type queuing as default with name P1, and enter into policy-map mode |
(config-pmap-que)#class type queuing default q2 | Configure class-map of type queuing as default for q0 and enter into class-map mode |
(config-pmap-c-que)#bandwidth percent 70 | Configure minimum bandwidth as 70 percent of total bandwidth available on interface |
(config-pmap-c-que)#exit | Exit out of policy-class mode |
(config-pmap-que)#class type queuing default q3 | Attach class q3 to Policy-map P1 |
(config-pmap-c-que)#bandwidth percent 30 | Configure minimum bandwidth as 30 percent of remaining bandwidth available on interface after all allocations are done. |
(config-pmap-c-que)#exit | Exit out of policy-class mode |
(config-pmap-que)#exit | Exit out of Policy-map mode |
(config)#class-map type qos c1 | Enter Class-map mode |
(config-cmap-qos)#match dscp 10 | Configure match criteria as dscp 10 |
(config-cmap-qos)#match cos 3 | Configure match criteria as cos 3 |
(config-cmap-qos)#exit | Exit out of class-map mode |
(config)#class-map type qos c2 | Enter Class-map mode |
(config-cmap-qos)#match dscp 22 | Configure match criteria as dscp 22 |
(config-cmap-qos)#match cos 4 | Configure match criteria as cos 4 |
(config-cmap-qos)#exit | Exit out of class-map mode |
(config)#policy-map type qos pmap1 | Configure policy-map with name pmap1 and enter policy-map mode |
(config-pmap-qos)#class type qos c1 | Assign Class c1 to Policy-map pmap1 |
(config-pmap-c-qos)#set precedence 2 | Set precedence to value 2 |
(config-pmap-c-qos)#exit | Exit out of pmap-c mode |
(config-pmap-qos)#class type qos c2 | Assign Class c2 to Policy-map pmap1 |
(config-pmap-c-qos)#set cos 2 | Set cos to value 2 |
(config-pmap-c-qos)#exit | Exit out of pmap-c mode |
(config)#interface xe3 | Enter interface mode |
(config-if)#service-policy type queuing output P1 | Attach service-policy P1 of type queuing on out direction |
(config-if)#exit | Exit out of interface mode |
(config)#interface xe2 | Enter interface mode |
(config-if)#service-policy type qos input pmap1 | Attach service-policy pmap1 of type qos on in direction |
(config-if)#exit | Exit out of interface mode |
(config)#bridge 1 protocol rstp vlan-bridge | Specify VLAN for bridge 1. |
(config)#vlan database | Enter the VLAN configuration mode. |
(config-vlan)#vlan 2-3 bridge 1 state enable | Enable VLAN (2-3) on bridge 1. Specifying the enable state. |
(config-vlan)#exit | Exit the VLAN configuration mode. |
(config)#interface vlan1.2 | Enter interface mode. |
(config-if)# ip address 10.1.1.2/24 | Configure the IP address. |
(config-if)#exit | Exit the interface mode. |
(config)#interface vlan1.3 | Enter interface mode. |
(config-if)# ip address 20.1.1.1/24 | Configure the IP address. |
(config-if)#exit | Exit the interface mode. |
(config)#interface xe2 | Enter interface mode. |
(config-if)#switchport | Configure xe2 as a Layer 2 port. |
(config-if)#bridge-group 1 | Associate the interface with bridge group 1. |
(config-if)#switchport mode trunk | Configure port as a trunk. |
(config-if)#switchport trunk allowed vlan all | Allow all the VLANs on the xe3 interface. |
(config-if)#exit | Exit the interface mode. |
(config)#interface xe3 | Enter interface mode. |
(config-if)#switchport | Configure xe3 as a Layer 2 port. |
(config-if)#bridge-group 1 | Associate the interface with bridge group 1. |
(config-if)#switchport mode trunk | Configure port as a trunk. |
(config-if)#switchport trunk allowed vlan all | Allow all the VLANs on the xe3 interface. |
(config-if)#exit | Exit the interface mode. |
Validation
Enter the commands listed in the sections below to confirm the configurations.
#show running-config qos
qos enable
!
qos statistics
!
class-map type qos c1
match dscp af11
match cos 2
!
class-map type qos c2
match dscp af23
match cos 4
!
policy-map type qos pmap1
class type qos c1
set precedence
immediate
exit
class type qos
c2
set cos 2
exit
!
policy-map type queuing default P1
class type queuing default q1
priority
bandwidth percent 70
exit
class type queuing q2
priority
bandwidth percent 30
exit
!
!
!
interface xe2
service-policy type qos input pmap1
!
interface xe3
service-policy type queuing output P1
!
#show policy-map interface xe2
Interface xe2
Type QoS statistics status : enabled
Class-map (qos): c1 (match all)
match dscp af11
match cos 3
set precedence 2
Class-map (qos): c2 (match all)
match dscp af23
match cos 4
set cos 2
Type Queuing policy-map : default-out-policy
Class-map (queuing): q0
priority
output : 0 packets, 0 bytes
dropped : 0 packets, 0 bytes
Class-map (queuing): q1
priority
output : 0 packets, 0 bytes
dropped : 0 packets, 0 bytes
Class-map (queuing): q2
priority
output : 0 packets, 0 bytes
dropped : 0 packets, 0 bytes
Class-map (queuing): q3
priority
output : 0 packets, 0 bytes
dropped : 0 packets, 0 bytes
Class-map (queuing): q4
priority
output : 0 packets, 0 bytes
dropped : 0 packets, 0 bytes
Class-map (queuing): q5
priority
output : 0 packets, 0 bytes
dropped : 0 packets, 0 bytes
Class-map (queuing): q6
priority
output : 6 packets, 724 bytes
dropped : 0 packets, 0 bytes
Class-map (queuing): q7
priority
output : 0 packets, 0 bytes
dropped : 0 packets, 0 bytes
Class-map (queuing): mc-q0
output : 0 packets, 0 bytes
dropped : 0 packets, 0 bytes
Class-map (queuing): mc-q1
output : 0 packets, 0 bytes
dropped : 0 packets, 0 bytes
Class-map (queuing): mc-q2
output : 0 packets, 0 bytes
dropped : 0 packets, 0 bytes
Class-map (queuing): mc-q3
output : 0 packets, 0 bytes
dropped : 0 packets, 0 bytes
Class-map (queuing): mc-q4
output : 0 packets, 0 bytes
dropped : 0 packets, 0 bytes
Class-map (queuing): mc-q5
output : 0 packets, 0 bytes
dropped : 0 packets, 0 bytes
Class-map (queuing): mc-q6
output : 0 packets, 0 bytes
dropped : 0 packets, 0 bytes
Class-map (queuing): mc-q7
output : 1 packets, 90 bytes
dropped : 0 packets, 0 bytes
Wred/Tail Drop Statistics :
----------------------
green : 0 packets
yellow : 0 packets
red : 0 packets
#show policy-map interface xe3
Interface xe3
Type Queuing policy-map : P1
Class-map (queuing): q0
priority
output : 0 packets, 0 bytes
dropped : 0 packets, 0 bytes
Class-map (queuing): q1
priority
output : 0 packets, 0 bytes
dropped : 0 packets, 0 bytes
Class-map (queuing): q2
priority
bandwidth percent 70
output : 0 packets, 0 bytes
dropped : 0 packets, 0 bytes
Class-map (queuing): q3
priority
bandwidth percent 30
output : 0 packets, 0 bytes
dropped : 0 packets, 0 bytes
Class-map (queuing): q4
priority
output : 0 packets, 0 bytes
dropped : 0 packets, 0 bytes
Class-map (queuing): q5
priority
output : 0 packets, 0 bytes
dropped : 0 packets, 0 bytes
Class-map (queuing): q6
priority
output : 0 packets, 0 bytes
dropped : 0 packets, 0 bytes
Class-map (queuing): q7
priority
output : 0 packets, 0 bytes
dropped : 0 packets, 0 bytes
Class-map (queuing): mc-q0
output : 0 packets, 0 bytes
dropped : 0 packets, 0 bytes
Class-map (queuing): mc-q1
output : 0 packets, 0 bytes
dropped : 0 packets, 0 bytes
Class-map (queuing): mc-q2
output : 0 packets, 0 bytes
dropped : 0 packets, 0 bytes
Class-map (queuing): mc-q3
output : 0 packets, 0 bytes
dropped : 0 packets, 0 bytes
Class-map (queuing): mc-q4
output : 0 packets, 0 bytes
dropped : 0 packets, 0 bytes
Class-map (queuing): mc-q5
output : 0 packets, 0 bytes
dropped : 0 packets, 0 bytes
Class-map (queuing): mc-q6
output : 0 packets, 0 bytes
dropped : 0 packets, 0 bytes
Class-map (queuing): mc-q7
output : 0 packets, 0 bytes
dropped : 0 packets, 0 bytes
Wred/Tail Drop Statistics :
----------------------
green : 0 packets
yellow : 0 packets
red : 0 packets