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