Huawei Network-layer 3 switching configuration
Using layer 3 switching technology to realize communication between vlan
Triple switching = layer 2 switching + layer 3 forwarding
Layer 2 should be re-encapsulated during layer 3 forwarding.
On a layer 3 switch, the layer 3 engine processes the first packet of the data flow
Routing once, switching multiple times
Experimental topology diagram
The steps of the experiment:
1. Configure the sw2 switch
Sys [Huawei] sysname SW2 [SW2] vlan batch 10 20 # # create vlan10 20 [SW2] int e0Accord 2 [SW2-Ethernet0/0/2] port link-type access # # Settingaccess [SW2-Ethernet0/0/2] port default vlan10 # put the interface in vlan [SW2-Ethernet0/0/2] un sh [SW2-Ethernet0/0/2] int e0and0and3 [SW2-Ethernet0/0/3] port link-type access [SW2-Ethernet0/0/ 3] port default vlan 20 [SW2-Ethernet0/0/3] un sh [SW2-Ethernet0/0/3] int e0trunk 1 [SW2-Ethernet0/0/1] port link-type trunk # # Settingtrunk [SW2-Ethernet0/0/1] port trunk allow-pass vlan all # allows all vlan to pass through [SW2-Ethernet0/0/1] un sh [SW2-Ethernet0/0/1] int g0Uniplet0Uniqqq1 [SW2-GigabitEthernet0/0/1] port link-type Trunk [SW2-GigabitEthernet0/0/1] port trunk allow-pass vlan all [SW2-GigabitEthernet0/0/1] un sh
2. Configure sw3 switch (same as sw2)
Sys [Huawei] sysname SW3 [SW3] vlan batch 10 20 [SW3] int e0/0/2 [SW3-Ethernet0/0/2] port link-type access [SW3-Ethernet0/0/2] port default vlan 10 [SW3-Ethernet0/0/2] un sh [SW3-Ethernet0/0/2] int e0/0/3 [SW3-Ethernet0/0/3] port link-type access [SW3-Ethernet0/0/3] port default vlan 20 [SW3-Ethernet0/0/3] un sh [SW3 -Ethernet0/0/3] int e0Accord 1 [SW3-Ethernet0/0/1] port link-type trunk [SW3-Ethernet0/0/1] port trunk allow-pass vlan all [SW3-Ethernet0/0/1] un sh
3. Configure sw1 layer 3 switch
Sys [Huawei] sysname SW1 [SW1] vlan batch 10 20 1000 [SW1] int g0x0x0xxx1 [SW1-GigabitEthernet0/0/1] port link-type trunk [SW1-GigabitEthernet0/0/1] port trunk allow-pass vlan all [SW1-GigabitEthernet0/0/1] un sh [SW1-GigabitEthernet0/0/1] int g0Unixpany 2 [SW1-GigabitEthernet0/0/2] port link-type access # # layer 3 switched connection routing cannot be configured with trunk [SW1-GigabitEthernet0/0/2] Port default vlan 1000 [SW1-GigabitEthernet0/0/2] un sh [SW1-GigabitEthernet0/0/2] Q [SW1] int vlanif 10 # # enter the logical interface [SW1-Vlanif10] ip add 192.168.10.1 24 # # set up the gateway [SW1-Vlanif10] int vlanif 20 [SW1-Vlanif20] ip add 192.168.20.1 24 [SW1] int vlanif 1000 [SW1-Vlanif1000] ip add 11.0.0.1 30 [SW1-Vlanif1000] Q [SW1] ip route-static 0 .0.0.0 0.0.0.0 11.0.0.2 # # set the default route Default up, static down
4. Configure R1 routing
Sys [Huawei] sysname R1 [R1] int g0 go 0 # # set the ip address of the interface [R1-GigabitEthernet0/0/0] ip add 11.0.0.2 30 [R1-GigabitEthernet0/0/0] un sh [R1-GigabitEthernet0/0/0] int loopback 0 # # enter the loopback interface Set ip [R1-LoopBack0] ip add 1.1.1.1 30 [R1-LoopBack0] Q [R1] ip route-static 192.168.10.0 24 11.0.0.1 # # set static route [R1] ip route-static 192.168.20.0 24 11.0.0.1
5. Test the interoperability of the whole network
The experiment is complete.
Check out more homepages on my homepage.