Applying a Traffic Policy

A class-based policy does not take effect unless it is applied to an interface.

Procedure

  1. Run system-view

    The system view is displayed.

  2. Run interface interface-type interface-number

    The interface view is displayed.

  3. (Optional) Run qos traffic-car member-link-scheduler distribute

    When CAR is configured on a trunk interface, the sum of all the member interfaces' bandwidth complies with the CAR settings.

    This command is supported only on Ethernet trunk interfaces.

  4. 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.

  5. Apply a traffic policy to an interface board.
    1. Run system-view

      The system view is displayed.

    2. Run slot slot-id

      The slot view is displayed.

    3. Perform one of the following operations as needed:

      • Run traffic-policy match-ip-layer { mpls-pop | mpls-push } *

        A board is configured to match only IP layer (Layer 3) information of incoming or outgoing packets on the public network against the traffic classifier.

      • To configure a board to match IP or MPLS information of incoming or outgoing packets on the public network against the traffic classifier, perform one or two of the following operations as needed:
        • Run traffic-policy match-mpls-layer { mpls-push | mpls-pop } *

          A board is configured to match IP and MPLS information of incoming or outgoing packets on the public network against the traffic classifier.

        • Run traffic-policy match-mpls-layer l2-inbound

          A board is configured to match MPLS information of outgoing packets on the public network against the traffic classifier in Layer 2 forwarding scenarios.

  6. Run commit

    The configuration is committed.

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