portswitch

Function

The portswitch command changes the mode of an Ethernet interface from Layer 3 to Layer 2.

The undo portswitch command changes the mode of an Ethernet interface from Layer 2 to Layer 3.

By default, an Ethernet interface works in Layer 3 mode.

Format

portswitch

undo portswitch

Parameters

None

Views

100GE interface view, 10GE interface view, 25GE interface view, 400GE-L2 view, 400GE interface view, 40GE interface view, Layer 2 50GE interface view, 50GE interface view, Eth-Trunk interface view, FlexE-100G interface view, FlexE-50G interface view, FlexE-50|100G interface view, FlexE interface view, GE optical interface view, GE electrical interface view

Default Level

2: Configuration level

Task Name and Operations

Task Name Operations
vlan write

Usage Guidelines

Usage Scenario

By default, Ethernet interfaces of Layer 3 devices such as the Router operate in Layer 3 mode. If these interfaces need to be added to a VLAN or other Layer 2 configurations need to be performed on these interfaces, the mode of these interfaces needs to be switched to Layer 2.

Precautions

When you run this command on an interface, the mode switching configuration takes effect when only attribute configurations (such as shutdown and description configurations) or configurations that are supported on Layer 2 or Layer 3 interfaces (such as modelacp and lacp system-id configurations) exist on the interface. Configurations that are not supported by the interface mode after the switch should not exist.

If other interfaces are configured with IP addresses unnumbered for the Ethernet and GE interfaces, the corresponding Ethernet and GE interfaces do not support the portswitch command

In addition, only Layer 2 Eth-Trunk interfaces can be bound to or unbound from a VLAN. If an Eth-Trunk interface is changed from the Layer 3 to Layer 2 mode, all Layer 3 functions and identifiers of the Eth-Trunk interface are disabled, and the system MAC address is used.

Eth-Trunk member interfaces do not support changes of the working mode between Layer 2 and Layer 3.

If an interface has sub-interfaces, interface mode switching affects forwarding of all the sub-interfaces.

After an Ethernet interface is switched from Layer 3 mode to Layer 2 mode, the link type of the Ethernet interface is Hybrid by default, and no default VLAN is configured for the interface.

Example

# Switch the mode of Eth-Trunk 1 to Layer 2.
<HUAWEI> system-view
[~HUAWEI] interface eth-trunk 1
[*HUAWEI-Eth-Trunk1] portswitch
# Switch the mode of GE 0/1/1 to Layer 2.
<HUAWEI> system-view
[~HUAWEI] interface GigabitEthernet 0/1/1
[~HUAWEI-GigabitEthernet0/1/1] portswitch
Copyright ? Huawei Technologies Co., Ltd.
Copyright ? Huawei Technologies Co., Ltd.
< Previous topic Next topic >