< Home

portswitch

Function

The portswitch command changes the working mode of Ethernet interfaces from Layer 3 mode to Layer 2 mode.

The undo portswitch command changes the working mode of Ethernet interfaces from Layer 2 mode to Layer 3 mode.

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

Format

portswitch

undo portswitch

Parameters

None

Views

GE interface view, XGE interface view, 25GE interface view, 40GE interface view, 100GE interface view, Eth-Trunk interface view, port group view, MultiGE interface view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

By default, an Ethernet interface on the device works in Layer 2 mode. To enable Layer 3 functions on the interface, run the undo portswitch command on the interface.

Precautions

  • If an interface has the non-attribute configuration, this command cannot be executed. Before running this command, delete the non-attribute configuration on the interface.
  • The minimum interval between running the portswitch and undo portswitch commands must be 30s.

Only interfaces on the S5720-EI, S5720-HI, S5730-HI, S5731-H, S5731-S, S5731S-H, S5731S-S, S5732-H, S6720-EI, S6720-HI, S6720S-EI, S6730-H, S6730S-H, S6730-S, and S6730S-S support switching between Layer 2 and Layer 3 modes.

Ethernet interfaces working at Layer 3 support IP address configuration.

By default, Ethernet interfaces on the device work at Layer 2 mode and have been added to VLAN 1. You can run the undo portswitch command to change the working mode to Layer 3 mode. The Ethernet interfaces are removed from VLAN 1 only after Layer 3 protocols become Up.

Example

# Change the working mode of GE0/0/1 from Layer 2 mode to Layer 3 mode.

<HUAWEI> system-view
[HUAWEI] interface gigabitethernet 0/0/1
[HUAWEI-GigabitEthernet0/0/1] undo portswitch
[HUAWEI-GigabitEthernet0/0/1] ip address 10.10.10.10 255.255.255.0 
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >