In a Cisco switch, how does one configure QOS speed limit? How to restrict BT download? This blog will use detailed examples for your explanation.
Instance 1: QOS speed limit problem on CISCO switches
It is used to control the bandwidth of a leased line user on a vswitch. The vswitch is usually at 10/100/1000 or three rates. QOS is required for other rates. You can also limit some ports, policy to restrict some ports.
I. Network Description
User‑pc1 is connected to Cisco3560 F0/1 at a rate of 1 M;
Ip_add 192.168.1.1/24
User2_PC2 is connected to Cisco3560 F0/2 at a rate of 2 M;
Ip_add 192.168.2.1/24
The G0/1 of Cisco3560 is an exit or cascade port.
Ii. Detailed configuration process
Note: Each interface supports only one policy in each direction. One policy can be used for multiple interfaces. Therefore, the download speed limit of all PCs should be defined in the same policy (policy-map user-down in this example ), the difference between different PC rates is defined in Class-map.
1. Start qos on the vswitch
Switch (config) # mls qos // start QOS on the Switch
2. Define the PC1 (192.168.1.1) and PC2 (192.168.2.1) access control lists respectively.
Switch (config) # access-list 1 permit 192.168.1.0 0.0.255 // control pc1 upstream traffic
Switch (config) # access-list 101 permit any 192.168.1.0 0.0.255 // control downstream pc1 traffic
Switch (config) # access-list 2 permit 192.168.1.2 0 0.0.255 // control pc2 upstream traffic
Switch (config) # access-list 102 permit any 192.168.2.1 0.0.255 // control downstream traffic of pc2
3. Define the class and bind it to the access control list defined above
Switch (config) # class-map user1-up // defines the PC1 upstream class and binds the access list 1
Switch (config-cmap) # match access-group 1
Switch (config-cmap) # exit
Switch (config) # class-map user2-up
Switch (config-cmap) # match access-group 2 // defines the upstream class of PC2 and binds it to access list 2
Switch (config-cmap) # exit
Switch (config) # class-map user1-down
Switch (config-cmap) # match access-group 101 // define the downstream class of PC1 and bind it to access list 101
Switch (config-cmap) # exit
Switch (config) # class-map user2-down
Switch (config-cmap) # match access-group 102 // define the downstream class of PC2 and bind it to access list 102
Switch (config-cmap) # exit
4. define a policy and bind the class defined above to the policy
Switch (config) # policy-map user1-up // defines the PC1 upstream speed as 1 M, exceeding the discard
Switch (config-pmap) # class user1-up
Switch (config-pmap-c) # trust dscp
Switch (config-pmap-c) # police 1000000 1000000 exceed-action drop
Switch (config) # policy-map user2-up // defines the PC2 upstream speed as 2 M, exceeding the discard
Switch (config-pmap) # class user2-up
Switch (config-pmap-c) # trust dscp
Switch (config-pmap-c) # police 2000000 2000000 exceed-action drop
Switch (config) # policy-map user-down
Switch (config-pmap) # class user1-down
Switch (config-pmap-c) # trust dscp
Switch (config-pmap-c) # police 1000000 1000000 exceed-action drop
Switch (config-pmap-c) # exit
Switch (config-pmap) # class user2-down
Switch (config-pmap-c) # trust dscp
Switch (config-pmap-c) # police 2000000 2000000 exceed-action drop
Switch (config-pmap-c) # exit
5. apply policies on interfaces
Switch (config) # interface f0/1
Switch (config-if) # service-policy input user1-up
Switch (config) # interface f0/2
Switch (config-if) # service-policy input user2-up
Switch (config) # interface g0/1
Switch (config-if) # service-policy input user-down