1. Network description
PC1 is connected to Cisco3550 F0/1, and the rate is 1M;
PC1 is connected to Cisco3550 F0/2, and the rate is 2M;
G0/1 of Cisco3550 is exported.
2. Detailed configuration process
Note: Each interface supports only one policy in each direction; a policy can be used for multiple interfaces. Therefore, the limits on download rate of all PCs should be defined in the same policy (in this example
The difference between different rates of PC is defined separately in Class-map.
1. Start QOS on the switch
Switch(config)#mls qos //Start QOS on the switch
2. Define the access control list of PC1 (10.10.1.1) and PC2 (10.10.2.1) respectively
Switch(config)#access-list 10 permit 10.10.1.0 0.0.0.255 //Control PC1 upstream traffic
Switch(config)#access-list 100 permit any 10.10.1.0 0.0.0.255 //Control pc1 downstream traffic
Switch(config)#access-list 11 permit 10.10.2.0 0.0.0.255 //Control PC2 upstream traffic
Switch(config)#access-list 111 permit any 10.10.2.0 0.0.0.255 //Control PC2 downstream traffic
3. Define the class and bind it to the access control list defined above.
Switch(config)# class-map user1-up //Define the class on PC1 and bind access list 10
Switch(config-cmap)# match access-group 10
Switch(config-cmap)# exit
Switch(config)# class-map user2-up
Switch(config-cmap)# match access-group 11 //Define the class on PC2 and bind the access list 10
Switch(config-cmap)# exit
Switch(config)# class-map user1-down
Switch(config-cmap)# match access-group 100 //Define the class downstream of PC1 and bind the access list 100
Switch(config-cmap)# exit
Switch(config)# class-map user2-down
Switch(config-cmap)# match access-group 111 //Define the class downstream of PC2 and bind the access list 111
Switch(config-cmap)# exit
4. Define the policy and bind the class defined above to the policy
Switch(config)# policy-map user1-up //Define the PC1 uplink rate to 1M
Switch(config-pmap)# class user1-up
Switch(config-pmap-c)# trust dscp
Switch(config-pmap-c)# police 1024000 1024000 exceed-action drop
Switch(config)# policy-map user2-up //Define the PC2 uplink rate to 2M
Switch(config-pmap)# class user2-up
Switch(config-pmap-c)# trust dscp
Switch(config-pmap-c)# police 2048000 1024000 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 1024000 1024000 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 2048000 1024000 exceed-action drop
Switch(config-pmap-c)# exit
5. Use strategies on the interface
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 Article entry: csh Editor in charge: csh
PC1 is connected to Cisco3550 F0/1, and the rate is 1M;
PC1 is connected to Cisco3550 F0/2, and the rate is 2M;
G0/1 of Cisco3550 is exported.
2. Detailed configuration process
Note: Each interface supports only one policy in each direction; a policy can be used for multiple interfaces. Therefore, the limits on download rate of all PCs should be defined in the same policy (in this example
The difference between different rates of PC is defined separately in Class-map.
1. Start QOS on the switch
Switch(config)#mls qos //Start QOS on the switch
2. Define the access control list of PC1 (10.10.1.1) and PC2 (10.10.2.1) respectively
Switch(config)#access-list 10 permit 10.10.1.0 0.0.0.255 //Control PC1 upstream traffic
Switch(config)#access-list 100 permit any 10.10.1.0 0.0.0.255 //Control pc1 downstream traffic
Switch(config)#access-list 11 permit 10.10.2.0 0.0.0.255 //Control PC2 upstream traffic
Switch(config)#access-list 111 permit any 10.10.2.0 0.0.0.255 //Control PC2 downstream traffic
3. Define the class and bind it to the access control list defined above.
Switch(config)# class-map user1-up //Define the class on PC1 and bind access list 10
Switch(config-cmap)# match access-group 10
Switch(config-cmap)# exit
Switch(config)# class-map user2-up
Switch(config-cmap)# match access-group 11 //Define the class on PC2 and bind the access list 10
Switch(config-cmap)# exit
Switch(config)# class-map user1-down
Switch(config-cmap)# match access-group 100 //Define the class downstream of PC1 and bind the access list 100
Switch(config-cmap)# exit
Switch(config)# class-map user2-down
Switch(config-cmap)# match access-group 111 //Define the class downstream of PC2 and bind the access list 111
Switch(config-cmap)# exit
4. Define the policy and bind the class defined above to the policy
Switch(config)# policy-map user1-up //Define the PC1 uplink rate to 1M
Switch(config-pmap)# class user1-up
Switch(config-pmap-c)# trust dscp
Switch(config-pmap-c)# police 1024000 1024000 exceed-action drop
Switch(config)# policy-map user2-up //Define the PC2 uplink rate to 2M
Switch(config-pmap)# class user2-up
Switch(config-pmap-c)# trust dscp
Switch(config-pmap-c)# police 2048000 1024000 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 1024000 1024000 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 2048000 1024000 exceed-action drop
Switch(config-pmap-c)# exit
5. Use strategies on the interface
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 Article entry: csh Editor in charge: csh