22Defining a policyYou associate a behavior with a class in a QoS policy to perform the actions defined in the behavior forthe class of packets.Configuration restrictions and guidelines• If an ACL is referenced by a QoS policy for defining traffic match criteria, packets matching the ACLare organized as a class and the behavior defined in the QoS policy applies to the class regardlessof whether the action in the rule is deny or permit.• In a QoS policy with multiple class-to-traffic-behavior associations, if the action of creating an outerVLAN tag, setting customer network VLAN ID, or setting service provider network VLAN ID isconfigured in a traffic behavior, do not configure any other action in this traffic behavior; otherwise,the QoS policy may not function as expected after it is applied. For more information about theaction of setting customer network VLAN ID or service provider network VLAN ID, see Layer2—LAN Switching Configuration Guide.Configuration procedureTo associate a class with a behavior in a policy:Step Command Remarks1. Enter system view. system-view N/A2. Create a policy and enterpolicy view. qos policy policy-name N/A3. Associate a class with abehavior in the policy.classifier tcl-name behaviorbehavior-nameRepeat this step to create moreclass-behavior associations.Applying the QoS policyYou can apply a QoS policy to the following occasions:• An interface—The policy takes effect on the traffic received on the interface.• A user profile—The policy takes effect on the traffic received by the online users of the user profile.• A VLAN—The policy takes effect on the traffic sreceived on all ports in the VLAN.• Globally—The policy takes effect on the traffic received on all ports.• Control plane—The policy takes effect on the traffic received on the control plane.The QoS policies applied to ports, to VLANs, and globally are in the descending priority order. If thesystem finds a matching QoS policy for the incoming/outgoing traffic, the system stops matching thetraffic against QoS policies.You can modify classes, behaviors, and class-behavior associations in a QoS policy applied to aninterface, VLAN, or inactive user profile, or globally. If a class references an ACL for traffic classification,you can delete or modify the ACL (such as add rules to, delete rules from, and modify rules of the ACL).If a QoS policy has been applied to an active user profile, you cannot modify classes, behaviors, andclass-behavior associations of the QoS policy, or delete the QoS policy.