< Home

encapsulation (Layer 2 sub-interface view)

Function

The encapsulation command configures the encapsulation mode of packets allowed to pass a Layer 2 sub-interface.

The undo encapsulation command deletes the encapsulation mode of packets allowed to pass a Layer 2 sub-interface.

By default, the encapsulation mode of packets allowed to pass a Layer 2 sub-interface is not configured.

Format

encapsulation { dot1q vid low-pe-vid [ to high-pe-vid ] | default | untag | qinq vid low-vlan-vid [ to high-vlan-vid ] ce-vid low-ce-vid [ to high-ce-vid ] }

undo encapsulation { dot1q vid low-pe-vid [ to high-pe-vid ] | default | untag | qinq vid low-vlan-vid [ to high-vlan-vid ] ce-vid low-ce-vid [ to high-ce-vid ] }

Parameters

Parameter Description Value

dot1q

Sets encapsulation mode of packets allowed to pass a Layer 2 sub-interface to Dot1q. This mode enables a Layer 2 sub-interface to receive packets with a VLAN tag.

-

vid low-pe-vid [ to high-pe-vid ]

Specifies the outer VLAN ID in packets allowed to pass a Layer 2 sub-interface in Dot1q encapsulation mode.

  • low-pe-vid: specifies the start VLAN ID.
  • high-pe-vid: specifies the end VLAN ID. high-pe-vid must be greater than or equal to low-pe-vid. high-pe-vid and low-pe-vid define a range of VLAN IDs.
  • If you do not specify to high-pe-vid, low-pe-vid specifies the single VLAN ID carried in packets.

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

default

Sets the encapsulation mode of packets allowed to pass a Layer 2 sub-interface to default. This mode enables a Layer 2 sub-interface to receive all packets, regardless of whether they contain VLAN tags.

-

untag

Sets the encapsulation mode of packets allowed to pass a Layer 2 sub-interface to untag. This mode enables a Layer 2 sub-interface to receive packets without VLAN tags.

-

qinq

Sets encapsulation mode of packets allowed to pass a Layer 2 sub-interface to QinQ. This mode enables a Layer 2 sub-interface to receive packets with double VLAN tags.

-

vid low-vlan-vid [ to high-vlan-vid ]

Specifies the outer VLAN ID in double-tagged packets allowed to pass a Layer 2 sub-interface in QinQ encapsulation mode.

  • low-vlan-id: specifies the start VLAN ID.
  • high-vlan-id: specifies the end VLAN ID. high-vlan-id must be greater than or equal to low-vlan-id. high-vlan-id and low-vlan-id define a range of VLAN IDs.
  • If you do not specify to high-vlan-id, low-vlan-id specifies the single VLAN ID carried in packets.

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

ce-vid low-ce-vid [ to high-ce-vid ]

Specifies the inner VLAN ID in double-tagged packets allowed to pass a Layer 2 sub-interface in QinQ encapsulation mode.

  • low-ce-vid: specifies the start VLAN ID in an inner tag.
  • high-ce-vid: specifies the end VLAN ID in an inner tag. high-ce-vid must be greater than or equal to low-ce-vid. high-ce-vid and low-ce-vid define a range of VLAN IDs in an inner VLAN tag.
  • If you do not specify to high-ce-vid, low-ce-vid specifies the single VLAN ID in the inner VLAN tag carried in packets.

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

Views

Layer 2 sub-interface view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

On a VXLAN network, a Layer 2 sub-interface functions as a VXLAN service access point to forward data packets in a BD.

Packets passing through a physical interface may contain one or two VLAN tags or no VLAN tag. After you run the encapsulation command in a Layer 2 sub-interface view to configure the encapsulation mode, the sub-interface can forward only specified types of packets.

Prerequisites

Run the command interface interface-type interface-number.subnum mode l2 to create a VXLAN Layer 2 sub-interface

Precautions

When configuring an encapsulation mode on a Layer 2 sub-interface, pay attention to the following points:

  • The VLAN ID in dot1q mode or outer VLAN ID in qinq mode cannot be the same as the allowed VLAN of the corresponding main interface or the global VLAN.

  • On the same main interface, the VLAN ID in dot1q mode and the outer VLAN ID in qinq mode must be different.

  • After NAC authentication is configured on the main interface, the traffic encapsulation type on a Layer 2 sub-interface cannot be set to default.

  • When the encapsulation mode of a Layer 2 sub-interface is default, the corresponding main interface cannot be added to any VLAN, including VLAN 1.

  • Before the encapsulation mode of a Layer 2 sub-interface is set to default, the main interface has only one sub-interface.

  • After the encapsulation mode of a Layer 2 sub-interface is set to default, no other sub-interface can be created on the main interface.

  • When the encapsulation mode of a Layer 2 sub-interface is set to untag, the corresponding main interface cannot be added to VLAN 1, and other sub-interfaces of the main interface cannot be set to untag.

  • You can configure only one encapsulation mode for each Layer 2 sub-interface. If an encapsulation mode has been configured for a Layer 2 sub-interface, run the undo encapsulation command to delete the original mode before you configure another mode.

  • Before configuring a VLAN segment on a Dot1q or QinQ Layer 2 sub-interface, you must run the rewrite pop none command.

Example

# Set the encapsulation mode of packets allowed to pass Layer 2 sub-interface GE0/0/0.1 to Dot1q and the outer VLAN ID in the packets to 10.
<HUAWEI> system-view
[HUAWEI] interface GigabitEthernet 0/0/1
[HUAWEI-GigabitEthernet0/0/1] port link-type hybrid
[HUAWEI-GigabitEthernet0/0/1] quit
[HUAWEI] interface gigabitethernet 0/0/1.1 mode l2
[HUAWEI-GigabitEthernet0/0/1.1] encapsulation dot1q vid 10
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >