Experimental topology
Experimental requirement
- Configure the IP address for PC1 and PC2 as shown in the figure
- PC1 belongs to VLAN 10, and PC2 belongs to VLAN 20. The VLAN if three-layer interface is configured on the three-layer switch to realize the three-layer interworking between VLAN 10 and VLAN 20.
-
Verification effect, all PC s can communicate with each other
Experimental steps
1. Configure IP address for PC1 and PC2 as shown in the figure
2. Create vlan on SW2, and divide the interface connecting PC into different vlan
[Huawei]vlan batch 10 20 [Huawei]int e0/0/2 [Huawei-Ethernet0/0/2]port link-t access [Huawei-Ethernet0/0/2]port default vlan 10 [Huawei-Ethernet0/0/2]int e0/0/3 [Huawei-Ethernet0/0/3]port link-type access [Huawei-Ethernet0/0/3]port default vlan 20
3. The uplink interface of SW2 is set to trunk mode, allowing the corresponding vlan to pass
[Huawei-Ethernet0/0/3]int e0/0/1 [Huawei-Ethernet0/0/1]port link-type trunk [Huawei-Ethernet0/0/1]port trunk allow-pass vlan 10 20
3. Create vlan on SW1 and divide the interface into different VLANs
Analysis: release and carry the corresponding VLAN tag data frame, then turn on VLAN 10 and VLAN 20 on SW1, configure VLAN IF10 interface IP address as VLAN 10 gateway address 192.168.1.254/24, configure VLAN IF20 interface IP address as VLAN 20 gateway address 192.168.2.254/24
[Huawei]vlan batch 10 20 [Huawei]int g0/0/1 [Huawei-GigabitEthernet0/0/1]port link-type trunk [Huawei-GigabitEthernet0/0/1]port trunk allow-pass 10 20 [Huawei-GigabitEthernet0/0/1]int vlan 10 [Huawei-Vlanif10]ip address 192.168.1.254 24 [Huawei-Vlanif10]int vlan 20 [Huawei-Vlanif20]ip address 192.168.2.254 24
4. Verification effect, PC1 and PC2 interworking
PC>ping 192.168.2.1 Ping 192.168.2.1: 32 data bytes, Press Ctrl_C to break Request timeout! From 192.168.2.1: bytes=32 seq=2 ttl=127 time=93 ms From 192.168.2.1: bytes=32 seq=3 ttl=127 time=63 ms From 192.168.2.1: bytes=32 seq=4 ttl=127 time=62 ms From 192.168.2.1: bytes=32 seq=5 ttl=127 time=94 ms --- 192.168.2.1 ping statistics --- 5 packet(s) transmitted 4 packet(s) received 20.00% packet loss round-trip min/avg/max = 0/78/94 ms