237
Enable QoS function, change the queue out weight of port Ethernet 0/0/1 to 1:2:4:8,
and set the port in trust QoS mode without changing DSCP value, and set the default
QoS value of the port to 5.
The configuration steps are listed below:
SWITCH # CONFIG
Switch(Config)#mls qos
Switch(Config)#interface Ethernet 0/0/1
Switch(Config-Ethernet0/0/1)#queue bandwidth 1 2 4 8
Switch(Config-Ethernet0/0/1)#mls qos trust cos pass-through dscp
Switch(Config-Ethernet0/0/1)#mls qos cos 5
Configuration result:
When QoS enabled in Global Mode, the egress queue bandwidth proportion of port
Ethernet 0/0/1 is 1:2:4:8. When packets have CoS value coming in through port Ethernet
0/0/1, it will be map to the queue out according to the CoS value, CoS value 0 to 7
correspond to queue out 1, 2, 3, 4, respectively. If the incoming packet has no CoS value,
it is default to 5 and will be put in queue 6. All passing packets would not have their
DSCP values changed.
Scenario 2:
In port Ethernet 0/0/2, set the bandwidth for packets from segment 192.168.1.0 to 10
Mb/s, with a burst value of 4 MB, all packets exceed this bandwidth setting will be
dropped.
The configuration steps are listed below:
SWITCH#CONFIG
Switch(Config)#access-list 1 permit 192.168.1.0 0.0.0.255
Switch(Config)#mls qos
Switch(Config)#class-map c1
Switch(Config-ClassMap)#match access-group 1
Switch(Config-ClassMap)# exit
Switch(Config)#policy-map p1
Switch(Config-PolicyMap)#class c1
Switch(Config--Policy-Class)#police 10000 4000 exceed-action drop
Switch(Config--Policy-Class)#exit
Switch(Config-PolicyMap)#exit
Switch(Config)#interface Ethernet 0/0/2
Switch(Config-Ethernet0/0/2)#service-policy input p1
Configuration result: