In Figure 1, 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.
Only 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.
The configuration roadmap is as follows:
Change interfaces to Layer 3 mode.
Configure the IP addresses of Layer 3 Ethernet interfaces as gateway addresses.
# Change a single interface to Layer 3 mode.
<HUAWEI> system-view [HUAWEI] sysname SwitchB [SwitchB] interface gigabitethernet 0/0/1 [SwitchB-GigabitEthernet0/0/1] undo portswitch [SwitchB-GigabitEthernet0/0/1] quit
# Change Ethernet interfaces to Layer 3 mode in a batch.
[SwitchB] undo portswitch batch gigabitethernet 0/0/2 to 0/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 0/0/4 [SwitchB-GigabitEthernet0/0/4] eth-trunk 1 [SwitchB-GigabitEthernet0/0/4] quit [SwitchB] interface gigabitethernet 0/0/5 [SwitchB-GigabitEthernet0/0/5] eth-trunk 1 [SwitchB-GigabitEthernet0/0/5] quit [SwitchB] interface eth-trunk 1 [SwitchB-Eth-Trunk1] undo portswitch [SwitchB-Eth-Trunk1] quit
# Configure the IP address of GE0/0/1 as a gateway address. The configurations of GE0/0/2, GE0/0/3, and GE0/0/4 are similar to the configuration of GE0/0/1. For details, see the configuration files.
[SwitchB] interface gigabitethernet 0/0/1 [SwitchB-GigabitEthernet0/0/1] ip address 10.10.1.1 24 [SwitchB-GigabitEthernet0/0/1] quit
Run the display interface GigabitEthernet 0/0/1 command in any view to check the interface working mode.
[SwitchB] display interface GigabitEthernet 0/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.
SwitchB configuration file
# sysname SwitchA # interface Eth-Trunk1 undo portswitch ip address 10.10.4.1 255.255.255.0 # interface GigabitEthernet0/0/1 undo portswitch ip address 10.10.1.1 255.255.255.0 # interface GigabitEthernet0/0/2 undo portswitch ip address 10.10.2.1 255.255.255.0 # interface GigabitEthernet0/0/3 undo portswitch ip address 10.10.3.1 255.255.255.0 # interface GigabitEthernet0/0/4 eth-trunk 1 # interface GigabitEthernet0/0/5 eth-trunk 1 # return