Method step
1. Please bring your own Huawei switch and computer, and connect the computer to the switch.
2. Use the system view command to enter [] mode.
3. Create a vlan.
[Quidditch] Virtual LAN 2
4. Add a port
[Quidway-VLAN 2] Ethernet ports 0/0/ 13 to 0/0/ 15.
5. Then use display current to check whether the port belongs to this vlan.
6. Of course, we can also use the display vlan to view vlan information.
7. configure vlan IP.
[Quidway] interface Vlanif 2
8. Configure the virtual LAN ip address.
[Quidway] interface Vlanif 2
[Quidway-Vlanif2]ip address10.10.1255.255.0
9. After the configuration is completed, use display current again to view the configuration information. As shown in the figure below, you can see the ip address of vlanif.
After 10, connect the computer to the interface of vlan2, set your own IP address, and then ping10.1to see if it is normal.
Related reading: How the switch works.
Switches work at the second layer of the OSI reference model, namely the data link layer. When each port is connected successfully, the CPU inside the switch will match the MAC address with the port to form a MAC table. In future communication, packets sent to this MAC address will only be sent to its corresponding port, not all ports. Therefore, the switch can be used to divide the data link layer broadcast, that is, the collision domain; But you can't divide the network layer broadcast, that is, the broadcast domain.