Applying a Traffic Policy

A class-based traffic policy takes effect only when it is applied to an interface.

Procedure

  1. Run system-view

    The system view is displayed.

  2. Perform the following operations based on the interfaces on which a traffic policy is used:

    • Apply a traffic policy on a Layer 3 interface.
      1. To enter the Layer 3 interface view, run the interface interface-type interface-number command.
      2. To apply a traffic policy to the Layer 3 interface, run the traffic-policy policy-name { inbound | outbound } [ all-layer | link-layer | mpls-layer ] command.

        If you specify link-layer, the router matches Layer 2 information about packets with the traffic policy and performs a corresponding action.

        If you specify mpls-layer, the router performs complex traffic classification based on MPLS packet header information.

        If you specify all-layer, the device first performs rule-matching according to Layer 2 information and implements a corresponding traffic action. If Layer 2 information of a packet does not match the traffic rule, the system performs rule-matching according to Layer 3 information and implements a corresponding traffic action.

    • Apply a traffic policy on a Layer 2 interface. You can specify a VLAN ID range to apply the traffic policy on the Layer 2 interface.
      1. To enter the Layer 3 interface view, run the interface interface-type interface-number command.
      2. To change the interface mode from Layer 3 to Layer 2, run the portswitch command.
      3. To add the Layer 2 interface to specific VLANs in tagged mode, run the port trunk allow-pass vlan { { vlan-id1 [ to vlan-id2 ] } &<1-10> | all } command.
      4. To apply a traffic policy on the Layer 2 interface, run the traffic-policy policy-name { inbound | outbound } vlan { vlan-id1 [ to vlan-id2 ] | all } [ all-layer | link-layer | mpls-layer ] command.
    • Apply a traffic policy on an EVC Layer 2 sub-interface. You can specify a bandwidth allocation type to apply the traffic policy on the EVC Layer 2 sub-interface.
      1. To enter the EVC Layer 2 sub-interface view, run the interface interface-type interface-number.subnum mode l2 command.
      2. To apply a traffic policy on the EVC Layer 2 sub-interface, run the traffic-policy policy-name { inbound | outbound } identifier { none | vid | ce-vid | vid-ce-vid } [ all-layer | link-layer | mpls-layer ] command.

        The parameter identifier specified bandwidth allocation type must be the same as the one configured on the EVC Layer 2 sub-interface.

    • Apply a traffic policy on a QinQ VLAN tag termination sub-interface. You can specify a PVLAN ID and CVLAN ID range to apply the traffic policy on the QinQ VLAN tag termination sub-interface.
      1. To enter the sub-interface view, run the interface interface-type interface-number.subinterface-number command.
      2. To set a VLAN ID range for the sub-interface and configure the sub-interface to remove the tags from double-tagged packets, run the encapsulation qinq-termination [ local-switch | rt-protocol ] command.
      3. To configure the sub-interface as a QinQ VLAN tag termination sub-interface, run the qinq termination pe-vid pe-vid [ to high-pe-vid ] ce-vid ce-vid [ to high-ce-vid ] [ vlan-group group-id ] command.
      4. To apply a traffic policy on the QinQ VLAN tag termination sub-interface, run the traffic-policy policy-name { inbound | outbound } pe-vid pe-vid ce-vid ce-vid1 [ to ce-vid2 ] [ all-layer | link-layer | mpls-layer ] command.

        To apply a traffic policy to a QinQ VLAN tag termination sub-interface, you can also directly run the traffic-policy policy-name { inbound | outbound } [ all-layer | link-layer | mpls-layer ] command without specifying a PVLAN ID or CVLAN ID range.

  3. Run commit

    The configuration is committed.

Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >