Example for Changing an Interface to Layer 3 Mode
Networking Requirements
In Figure 2-14, PC1, PC2, and PC3 are on three network segments, and SwitchC, SwitchD, and SwitchE are access switches for the three network segments, respectively. To enable SwitchA and SwitchB to communicate with each other and provide high link bandwidth, Layer 3 Eth-Trunk interfaces need to be used between SwitchA and SwitchB. In addition, three physical Ethernet interfaces on SwitchB need to be used as gateway interfaces for the three network segments.
Configuration Roadmap
The configuration roadmap is as follows:
Change interfaces to Layer 3 mode.
Configure the IP addresses of Layer 3 Ethernet interfaces as gateway addresses.
Procedure
- Change interfaces to Layer 3 mode.
# Change a single interface to Layer 3 mode.
<HUAWEI> system-view [HUAWEI] sysname SwitchB [SwitchB] interface gigabitethernet 1/0/1 [SwitchB-GigabitEthernet1/0/1] undo portswitch [SwitchB-GigabitEthernet1/0/1] quit
# Change Ethernet interfaces to Layer 3 mode in a batch.
[SwitchB] undo portswitch batch gigabitethernet 1/0/2 to 1/0/3
# Configure an Eth-Trunk interface and change it to Layer 3 mode.
[SwitchB] interface eth-trunk 1 [SwitchB-Eth-Trunk1] quit [SwitchB] interface gigabitethernet 1/0/4 [SwitchB-GigabitEthernet1/0/4] eth-trunk 1 [SwitchB-GigabitEthernet1/0/4] quit [SwitchB] interface gigabitethernet 1/0/5 [SwitchB-GigabitEthernet1/0/5] eth-trunk 1 [SwitchB-GigabitEthernet1/0/5] quit [SwitchB] interface eth-trunk 1 [SwitchB-Eth-Trunk1] undo portswitch [SwitchB-Eth-Trunk1] quit
- Configure the IP addresses of Layer 3 Ethernet interfaces as gateway addresses.
# Configure the IP address of GE1/0/1 as a gateway address. The configurations of GE1/0/2, GE1/0/3, and GE1/0/4 are similar to the configuration of GE1/0/1. For details, see the configuration files.
[SwitchB] interface gigabitethernet 1/0/1 [SwitchB-GigabitEthernet1/0/1] ip address 10.10.1.1 24 [SwitchB-GigabitEthernet1/0/1] quit
- Verify the configuration.
Run the display interface GigabitEthernet 1/0/1 command in any view to check the interface working mode.
[SwitchB] display interface GigabitEthernet 1/0/1 ... Description: Route Port,The Maximum Frame Length is 9216 Internet protocol processing : disabled ...
The command output shows that the interface works in Layer 3 mode.
Configuration Files
SwitchB configuration file
# sysname SwitchA # interface Eth-Trunk1 undo portswitch ip address 10.10.4.1 255.255.255.0 # interface GigabitEthernet1/0/1 undo portswitch ip address 10.10.1.1 255.255.255.0 # interface GigabitEthernet1/0/2 undo portswitch ip address 10.10.2.1 255.255.255.0 # interface GigabitEthernet1/0/3 undo portswitch ip address 10.10.3.1 255.255.255.0 # interface GigabitEthernet1/0/4 eth-trunk 1 # interface GigabitEthernet1/0/5 eth-trunk 1 # return