< Home

add-tag vlan-id

Function

The add-tag vlan-id command configures an action of adding an outer VLAN tag in a traffic behavior.

The undo add-tag command deletes the action.

By default, no action of adding an outer VLAN tag is configured in a traffic behavior.

Only the S5730-SI, S5730S-EI, S6720-LI, S6720S-LI, S6720-SI, and S6720S-SI support this command.

Format

add-tag vlan-id vlan-id

undo add-tag

Parameters

Parameter

Description

Value

vlan-id

Specifies the VLAN ID in the outer VLAN tag.

The value is an integer that ranges from 1 to 4094.

Views

Traffic behavior view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

When the downstream device needs to provide services based on the outer VLAN tag, run the add-tag vlan-id command to configure the device to add an outer VLAN tag to packets matching the traffic classifier.

Follow-up Procedure

Run the traffic policy command to create a traffic policy and run the classifier behavior command in the traffic policy view to bind the traffic classifier to the traffic behavior containing the action of adding an outer VLAN tag.

Precautions

  • After the add-tag vlan-id, remark 8021p, remark cvlan-id or remark vlan-id command is used, the system modifies the VLAN tag of packets according to its configuration. The behavior configured through these commands is called VLAN-based action.

    To apply a VLAN-based action and a non-VLAN-based action to the same upstream traffic policy, configure the VLAN-based action and non-VLAN-based action in different traffic behaviors bound to the same traffic policy.

  • In the scenario where a traffic policy is bound to multiple pairs of traffic classifiers and traffic behaviors, a traffic behavior contains add-tag vlan-id, and a traffic classifier bound to another traffic behavior that does not define any VLAN-specific actions defines if-match vlan-id, the VLAN ID specified by add-tag vlan-id is matched. If another traffic behavior defines if-match cvlan-id, the VLAN ID in the packets is matched.
  • The add-tag vlan-id command is invalid for double-tagged VLAN packets.

  • When port vlan-stacking, port vlan-stacking untagged, or port link-type dot1q-tunnel is configured on an interface to add a VLAN tag to packets so that packets carry double VLAN tags, the add-tag vlan-id command is invalid for the double-tagged VLAN packets.

  • If you run the add-tag vlan-id command in the same traffic classifier view multiple times, only the latest configuration takes effect.

Example

# Configure an action of adding an outer VLAN tag for traffic behavior tb to 100.

<HUAWEI> system-view
[HUAWEI] traffic behavior tb
[HUAWEI-behavior-tb] add-tag vlan-id 100
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >