! enable qos qos ! define policer, for rate and burst values, see 'policing parameters qos aggregate-policer pol_1mbps 1mbps 1000 conform-action transmit exceed-action drop ! define ACL to select traffic access-list 111 permit udp any any eq 111 ! define traffic class to be policed class-map match-all cl_test match access-group 111 ! define QoS policy, attach policer to traffic class policy-map po_test class cl_test police aggregate pol_1mbps ! apply QoS policy to an interface interface FastEthernet5/14 switchport access vlan 2 ! switch qos to vlan-based mode on this port qos vlan-based ! apply QoS policy to an interface interface Vlan 2 service-policy output po_test !
! enable qos qos ! define traffic class to be policed class-map match-all cl_test2 match ip precedence 3 4 ! define QoS policy, attach policer to traffic class policy-map po_test2 class cl_test2 ! per-interface policer is defined inside the policy map police 512k 1000 conform-action transmit exceed-action drop interface FastEthernet5/14 switchport ! set port to trust DSCP - need this to be able to match to incoming IP precedence qos trust dscp ! switch to port-based qos mode no qos vlan-based ! apply QoS policy to an interface service-policy input po_test2