interface l2

Function

The interface mode l2 command displays the view of an existing interface or creates a Layer 2 sub-interface and displays the Layer 2 sub-interface view.

The undo interface command deletes a Layer 2 sub-interface.

By default, this type of port is not created.

Format

interface { interface-name | interface-type interface-number } { mode l2 }

undo interface { interface-name | interface-type interface-number }

Parameters

Parameter Description Value
interface-name

Specifies an interface name.

The value is a string of 1 to 63 case-sensitive characters, spaces not supported.

interface-type

Specifies the type of an interface.

-

interface-number

Specifies the number of an interface.

-

Views

System view

Default Level

2: Configuration level

Task Name and Operations

Task Name Operations
interface-mgr write

Usage Guidelines

Usage Scenario

The Ethernet virtual connection (EVC) module defines Layer 2 sub-interfaces as service access points. Only Layer 2 sub-interface provides access services. To create a Layer 2 sub-interface, run the interface mode l2 command.

The Virtual eXtensible Local Area Network (VXLAN) module defines Layer 2 sub-interfaces as service access points. Only Layer 2 sub-interface provide access services. To create a Layer 2 sub-interface, run the interface mode l2 command.

Precautions

After a logical interface is deleted using the undo interface command, all the configurations on the interface are automatically deleted. These configurations cannot be restored even if you create an interface same as the one deleted.

Layer 2 sub-interfaces can only send access packets to bridge domains, not Layer 3 networks. Each Layer 2 sub-interface can be added to only one BD.

Example

# Create a Layer 2 sub-interface GE 0/1/0.1.
<HUAWEI> system-view
[~HUAWEI] interface GigabitEthernet 0/1/0.1 mode l2
# Create a Layer 2 sub-interface 10GE 0/1/0.1.
<HUAWEI> system-view
[~HUAWEI] interface 10GE 0/1/0.1 mode l2
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.