How is an interface on an NE router switched between Layer 2 and Layer 3 modes

7

By default, an Ethernet interface of a Layer 3 device, such as a router, usually works in Layer 3 mode. To add the interface to a VLAN or perform other Layer 2 interface configurations, you must run the portswitch command to switch the Layer 3 interface to the Layer 2 mode. To switch the Layer 2 mode back to the Layer 3 mode, run the undo portswitch command. To switch Ethernet interfaces from the Layer 3 mode to the Layer 2 mode in batches, run the portswitch batch command. To switch Ethernet interfaces from the Layer 2 mode to the Layer 3 mode in batches, run the undo portswitch batch command.

Other related questions:
Do Ethernet interfaces on CE series switches support switching between Layer 2 and Layer 3 modes
Ethernet interfaces on all CE series switches, except the CE6810LI, support switching between Layer 2 and Layer 3 modes. By default, Ethernet interfaces on CE series switches work in Layer 2 mode. 1. Switching Layer 2 interface to Layer 3 mode: Run the undo portswitch command in the interface view to switch a Layer 2 interface to Layer 3 mode. Before switching, delete all non-default configurations from the interface. 2. Switching Layer 3 interface to Layer 2 mode: Run the portswitch command in the interface view to switch a Layer 3 interface to Layer 2 mode. Before switching, delete all Layer 3 service configurations from the interface.

How to configure a Layer 2 interface as a Layer 3 interface on a switch
By default, Ethernet interfaces on switches work as Layer 2 interfaces.Run the undo portswitch command to configure the Ethernet interfaces as Layer 3 interfaces. For switches in V200R003C00 and earlier versions: Only Layer 2 Ethernet interfaces on the S5700HI, S5710EI, and S5710HI can be configured as Layer 3 interfaces. After an Ethernet interface is configured as a Layer 3 interface, the interface cannot be configured with an IP address. For switches in V200R005C00 and later versions: Only Layer 2 Ethernet interfaces on the S5700HI, S5710EI, S5710HI, S5700EI, S5720EI, S5720HI, S6700EI, and S6720EI can be configured as Layer 3 interfaces. After an Ethernet interface is configured as a Layer 3 interface, the interface can be configured with an IP address.

Configuring Layer 2/Layer 3 switchover on the firewall
Perform as follows to configure Layer 2/Layer 3 interface switching on the USG2000&5000&6000: system-view [USG] interface GigabitEthernet 1/0/1 [USG-GigabitEthernet1/0/1] undo portswitch //Switch the interface from Layer 2 mode to Layer 3 mode. [USG-GigabitEthernet1/0/1] portswitch //Switch the interface from Layer 3 to Layer 2. Note: 1. If the device interface attribute specifies that the interface is a Layer 2 interface, the interface cannot be switched to Layer 3 mode. This command applies only to interfaces that support Layer 2/Layer 3 switching. 2. When you use this command to perform Layer 2/Layer 3 mode switching, the interface can contain only the attribute information (such as shutdown and description configurations) so that the mode switching can take effect. If the interface already has service configurations (such as port link-type trunk), clear all these configurations of the interface and then run this command.

Does an AR router support an interface being switched over between Layer 2 and Layer 3
The following AR routers support an interface being switched over between Layer 2 and Layer 3. By default, Ethernet interfaces are Layer 2 interfaces. Run the undo portswitch command to switch the interfaces from Layer 2 mode to Layer 3 mode, and run the portswitch command to switch the interfaces back to Layer 2 mode. V200R006C00 and earlier versions: - AR150 and AR200 series: Eth0/0/0 - AR120-S series: Eth0/0/0~Eth0/0/3 - AR150-S, AR160-S, and AR200-S series (except for AR151-S2): Eth0/0/0 - AR151-S2: GE0/0/0 - AR160 series: GE0/0/0 - AR1220F: Eth0/0/0~Eth0/0/7 - AR2201-48FE, AR2202-48FE, and AR2201-48FE-S: Eth0/0/0 and Eth0/0/47 V200R007C00: - AR120 and AR150 series, AR120-S series, AR151-S, AR151W-P-S, and AR151G-U-S: Eth0/0/0~Eth0/0/3 - AR160 series, AR509G-L-D-H, AR110-S series, AR151-S2 and AR160-S series: GE0/0/0~GE0/0/3 - AR200 series, AR1220, AR1220V, AR1220W, AR1220VW, AR1220F, AR200-S series, AR1220-S, AR1220W-S, and AR1220F-S: Eth0/0/0~Eth0/0/7 - AR1220C, AR1220E, AR1220EV, AR1220EVW, and AR1220E-S: GE0/0/0~GE0/0/7 - AR2201-48FE and AR2202-48FE: Eth0/0/0~Eth0/0/47 - AR2204-51GE-P: GE0/0/3~GE0/0/50 - AR2204-27GE-P, AR2204-27GE, and AR2201-48FE-S: GE0/0/3~GE0/0/26 V200R008C00: - AR120 (except for AR129CGVW-L) and AR150 series, AR120-S series, AR151-S, AR151W-P-S, and AR151G-U-S: Eth0/0/0~Eth0/0/3 -AR100 series, AR160 series, AR129CGVW-L, AR503EW, AR503EDGW-Lc, AR509CG-Lt, AR509CG-Lc, AR509G-Lc, AR515GW-LM9-D and AR509G-L-D-H, AR100-S series, AR110-S series, AR151-S2 and AR160-S series: GE0/0/0~GE0/0/3 - AR200 series, AR1220, AR1220V, AR1220W, AR1220VW, and AR1220F, AR200-S series, AR1220-S, AR1220W-S, and AR1220F-S series: Eth0/0/0~Eth0/0/7 - AR1220C, AR1220E, AR1220EV and AR1220EVW, and AR1220E-S: GE0/0/0~GE0/0/7 - AR2201-48FE, AR2202-48FE, and AR2201-48FE-S: Eth0/0/0 and Eth0/0/47 - AR2204-51GE-P, AR2204-51GE-R, and AR2204-51GE: GE0/0/3~GE0/0/50 - AR2204-27GE-P and AR2204-27GE: GE0/0/3~GE0/0/26 At present, the interfaces of all cards do not support Layer 2 and Layer 3 interface switchover.

Configuring the intranet interface to work in Layer 2 mode on the firewall
Perform as follows to switch a Layer 3 interface to a Layer 2 interface: [USG] interface GigabitEthernet 0/0/1 [USG-GigabitEthernet0/0/1] portswitch //Configure the interface to work in Layer 2 mode. To switch Layer 3 Ethernet interfaces to Layer 2 mode in batches, run the portswitch batch interface-type { interface-number1 [ to interface-number2 ] } &<1-10> command in the system view. By default, a Layer 2 Ethernet interface belongs to VLAN 1 and works as an access port.

If you have more questions, you can seek help from following ways:
To iKnow To Live Chat
Scroll to top