1. Configure Switch
# Create a VLAN
<Huawei> system-View
[Huawei] sysname Switch
[Switch] VLAN batch 10 20 30
# Adding a configuration interface to a VLAN
[Switch] interface gigabitethernet 0/0/1
[Switch-GigabitEthernet0/0/1] Port Link-type access
[Switch-GigabitEthernet0/0/1] Port default VLAN 10
[Switch-GigabitEthernet0/0/1] Quit
[Switch] interface gigabitethernet 0/0/2
[Switch-GigabitEthernet0/0/2] Port Link-type access
[Switch-GigabitEthernet0/0/2] Port default VLAN 20
[Switch-GigabitEthernet0/0/2] Quit
[Switch] interface gigabitethernet 0/0/3
[Switch-GigabitEthernet0/0/3] Port Link-type access
-[Switch-GigabitEthernet0/0/3] Port default VLAN 30
[Switch-GigabitEthernet0/0/3] Quit
# Configuring the IP address of the vlanif Interface
[Switch] interface vlanif 10
[Switch-Vlanif10] IP address 192.168.50.1 24
[Switch-Vlanif10] Quit
[Switch] interface vlanif 20
[Switch-Vlanif20] IP address 192.168.60.1 24
[Switch-Vlanif20] Quit
[Switch] interface vlanif 30
[Switch-Vlanif30] IP address 192.168.70.1 24
[Switch-Vlanif30] Quit
2. Check Configuration results
Set the IP address to 192.168.50.2/24 on the user1 host in vlan10. The default gateway is the IP address 192.168.50.1/24 of the vlanif10 interface.
Set the IP address to 192.168.60.2/24 on the user2 host in vlan20. The default gateway is the IP address 192.168.60.1/24 of the vlanif20 interface.
On the user3 host in vlan30, set the IP address to 192.168.70.2/24. The default gateway is the IP address 192.168.70.1/24 of the vlanif20 interface.
After the configuration is complete, user1 in vlan10 and user2 in vlan20 and user3 in vlan30 can access each other.