traffic-policy (interface view)

Function

The traffic-policy command applies a traffic policy to an interface.

The undo traffic-policy command deletes a traffic policy from an interface.

By default, no traffic policy is applied to an interface.

Format

undo traffic-policy { inbound | outbound }

traffic-policy policy-name { inbound | outbound } pe-vid pe-vid ce-vid ce-vid1 [ to ce-vid2 ] [ all-layer | link-layer | mpls-layer ]

traffic-policy policy-name { inbound | outbound } vlan { vlan-id1 [ to vlan-id2 ] | all } [ all-layer | link-layer | mpls-layer ]

traffic-policy policy-name { inbound | outbound } [ identifier { none | vid | ce-vid | vid-ce-vid } ] [ all-layer | link-layer | mpls-layer ]

traffic-policy policy-name { inbound | outbound } [ all-layer | link-layer | mpls-layer ]

undo traffic-policy [ policy-name ] { inbound | outbound } [ pe-vid pe-vid ce-vid ce-vid1 [ to ce-vid2 ] ] [ all-layer | link-layer | mpls-layer ]

undo traffic-policy [ policy-name ] { inbound | outbound } vlan { vlan-id1 [ to vlan-id2 ] | all } [ all-layer | link-layer | mpls-layer ]

undo traffic-policy [ policy-name ] { inbound | outbound } [ identifier { none | vid | ce-vid | vid-ce-vid } ] [ all-layer | link-layer | mpls-layer ]

undo traffic-policy [ policy-name ] { inbound | outbound } [ all-layer | link-layer | mpls-layer ]

traffic-policy policy-name { inbound | outbound } pe-vid pe-vid ce-vid ce-vid1 [ to ce-vid2 ] [ link-layer ]

traffic-policy policy-name { inbound | outbound } vlan { vlan-id1 [ to vlan-id2 ] | all } [ link-layer ]

traffic-policy policy-name { inbound | outbound } [ identifier { none | vid | ce-vid | vid-ce-vid } ] [ link-layer ]

traffic-policy policy-name { inbound | outbound } [ identifier { none | vid | ce-vid | vid-ce-vid } ] [ mpls-layer ]

traffic-policy policy-name { inbound | outbound } vlan { vlan-id1 [ to vlan-id2 ] | all } [ mpls-layer ]

traffic-policy policy-name { inbound | outbound } pe-vid pe-vid ce-vid ce-vid1 [ to ce-vid2 ] [ mpls-layer ]

undo traffic-policy [ policy-name ] { inbound | outbound } [ identifier { none | vid | ce-vid | vid-ce-vid } ] [ link-layer ]

undo traffic-policy [ policy-name ] { inbound | outbound } [ identifier { none | vid | ce-vid | vid-ce-vid } ] [ mpls-layer ]

undo traffic-policy [ policy-name ] { inbound | outbound } vlan { vlan-id1 [ to vlan-id2 ] | all } [ link-layer ]

undo traffic-policy [ policy-name ] { inbound | outbound } vlan { vlan-id1 [ to vlan-id2 ] | all } [ mpls-layer ]

undo traffic-policy [ policy-name ] { inbound | outbound } [ pe-vid pe-vid ce-vid ce-vid1 [ to ce-vid2 ] ] [ link-layer ]

undo traffic-policy [ policy-name ] { inbound | outbound } [ pe-vid pe-vid ce-vid ce-vid1 [ to ce-vid2 ] ] [ mpls-layer ]

traffic-policy policy-name { inbound | outbound }

Parameters

Parameter Description Value
inbound

Specifies the traffic policy in the inbound direction.

-

outbound

Specifies the traffic policy in the outbound direction.

-

policy-name

Specifies the name of a traffic policy.

The value is a string of 1 to 127 case-sensitive characters.

pe-vid pe-vid

Specifies a PE VLAN ID.

The value is a decimal integer ranging from 1 to 4094.

ce-vid

Indicates that bandwidth defined in the traffic behavior is shared based on the inner tag.

-

ce-vid ce-vid1

Specifies a start CE VLAN ID (inner VLAN ID).

The value is a decimal integer ranging from 1 to 4094.

to ce-vid2

Specifies an end CE VLAN ID (inner VLAN ID).

The value is a decimal integer ranging from 1 to 4094.

to vlan-id2

Specifies an end VLAN ID.

The value is an integer in the range 1 to 4094. vlan-id2 must be greater than vlan-id1.

all-layer

Specifies the following rule-matching method after an associated traffic policy is applied to an interface. The system first performs rule-matching according to Layer 2 information and implements a corresponding traffic action. If Layer 2 information about packets fails to match rules, the interface matches the packets against rules based on Layer 3 information (excluding MPLS-layer information) about the packets and performs corresponding actions.

-

link-layer

Classifies traffic based on Layer 2 information.

-

mpls-layer

Classifies traffic based on MPLS packet header information.

-

vlan

Specifies a VLAN for Layer 2 interface.

-

vlan-id1

Specifies a start VLAN ID.

The value is an integer in the range 1 to 4094.

all

All vlan.

-

identifier

Specifies the queue allocation type.

You can configure the identifier parameter to specify the queue allocation type. This parameter only takes effect for the non-shared policy. If the parameter identifier is not configured, all traffic the interface received share one policy instance. And this parameter can only be configured on the EVC sub-interface.

-

none

All VLANs on the interface share the bandwidth configured in the traffic behavior.

-

vid

Indicates that bandwidth defined in the traffic behavior is shared based on the outer tag.

-

vid-ce-vid

Indicates that bandwidth defined in the traffic behavior is shared based on both tags.

-

Views

100GE interface view, 10G LAN interface view, 10G WAN interface view, EVC view of a 10GE interface, 25GE interface view, 400GE interface view, 40GE interface view, 50GE interface view, Eth-Trunk interface view, FlexE interface view, GE optical interface view, GE electrical interface view, Global-VE layer2 subinterface view, Global VE sub-interface view, PW-VE sub-interface view, Tunnel interface view, VBDIF interface view, VE layer2 subinterface view, VE sub-interface view, VLANIF interface view, EVC view of an Eth-Trunk interface, EVC view of an Ethernet interface, EVC view of a GE interface, Bridge domain view

Default Level

2: Configuration level

Task Name and Operations

Task Name Operations
qos write

Usage Guidelines

Usage Scenario

To perform a traffic policy on an interface, you can run this command to configure a traffic policy in the interface view. You need specify a VLAN ID range for a Layer 2 interface before applying a complex traffic classification-based traffic policy on the Layer 2 interface. You can specify a PE VLAN ID and a CE VLAN ID for a QinQ termination sub-interface before applying a complex traffic classification-based traffic policy on the sub-interface.

Prerequisites

The traffic policy is configured.

Precautions

When a traffic policy is applied to the inbound direction of a VBDIF interface, redirection to multiple IP addresses is supported.

If member interfaces of a trunk interface reside on different forwarding or traffic management modules, the effective CIR or PIR for CAR or user-queue can be a multiple of the configured one.

On an interface, only one traffic policy can be applied to outgoing or incoming packets.

By default, the device performs complex traffic classification based on Layer 3 or Layer 4 information and MPLS packet header information and other information.

  • If you specify link-layer, the device performs complex traffic classification based on Layer 2 information about packets.
  • If you specify mpls-layer, the device 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.

    It is recommended that users configure the keyword link-layer or mpls-layer or all-layer in the command as required.

    When an inbound traffic policy is applied to a VBDIF interface or VLANIF interface view, the traffic policy takes effect for Layer 2 accessing Layer 3 traffic. When an outbound traffic policy is applied to a VBDIF interface or VLANIF interface view, the traffic policy takes effect for Layer 3 accessing Layer 2 traffic.

    The parameters of link-layer, mpls-layer, all-layer, and vlan are not available in the command for VBDIF interfaces or VLANIF interface view.

    If traffic received by a BD, VBDIF interface or VLANIF interface view comes from multiple interfaces that reside on different forwarding modules and the policy CAR is applied, the limited bandwidth of each forwarding module is the configured limited bandwidth, and the actual valid limited bandwidth of the BD, VBDIF interface or VLANIF interface view is the sum of the bandwidth of each forwarding module.

    If this command without the VLAN keyword is configured on a Layer 2 interface that is configured with the port vlan-stacking ce-default-vlan stack-vlan command, the command configuration takes effect only for untagged packets. If this command without the VLAN keyword is configured on a Layer 2 interface that is configured with the port vlan-stacking vlan command, this command can be delivered but does not take effect. If this command is required on any other Layer 2 interface, you must specify the VLAN keyword in this command.

    If both a QPPB policy and a traffic policy are configured on an interface, the QPPB policy takes effect preferentially.

Example

# Configure traffic policy p to classify traffic based on Layer 2 information on GE 0/1/0.1 (a QinQ termination sub-interface).
<HUAWEI> system-view
[~HUAWEI] traffic policy p
[*HUAWEI-trafficpolicy-p] quit
[*HUAWEI] interface GigabitEthernet 0/1/0.1
[*HUAWEI-GigabitEthernet0/1/0.1] control-vid 1 qinq-termination
[*HUAWEI-GigabitEthernet0/1/0.1] qinq termination pe-vid 1 ce-vid 1
[*HUAWEI-GigabitEthernet0/1/0.1] traffic-policy p inbound pe-vid 1 ce-vid 1
# Configure traffic policy p to classify traffic based on Layer 2 information on GE 0/1/0 (a Layer 2 interface).
<HUAWEI> system-view
[~HUAWEI] traffic policy p
[*HUAWEI-trafficpolicy-p] quit
[*HUAWEI] interface GigabitEthernet 0/1/0
[*HUAWEI-GigabitEthernet0/1/0] portswitch
[*HUAWEI-GigabitEthernet0/1/0] traffic-policy p inbound vlan 1
# Define traffic policy p on GE 0/1/0 and specify the link-layer parameter.
<HUAWEI> system-view
[~HUAWEI] traffic policy p
[*HUAWEI-trafficpolicy-p] quit
[*HUAWEI] interface GigabitEthernet 0/1/0
[*HUAWEI-GigabitEthernet0/1/0] traffic-policy p inbound link-layer
Copyright ? Huawei Technologies Co., Ltd.
Copyright ? Huawei Technologies Co., Ltd.
< Previous topic Next topic >