I. VLAN Basics
1. The concept of VLAN
VLAN (Virtual Local Area Network) is a logical subnet partitioning technology that can establish multiple virtual local area networks on the same physical switch. Different VLANs cannot communicate directly by default, thereby improving security and management efficiency.
Simply put, VLAN is like using an "invisible wall" to separate devices in different departments in the same building. They can only communicate within their own VLANs, unless they are specially configured to access other VLANs.
2. How VLAN works
VLAN is mainly implemented by dividing the switch ports. Common VLAN types are:
Port-based VLAN: VLANs are divided by ports, for example, ports 1-5 belong to VLAN 10, and ports 6-10 belong to VLAN 20.
MAC-based VLAN: The MAC address of the device determines the VLAN affiliation. Even if the switch port is changed, it still belongs to the original VLAN.
Protocol-based VLAN: VLANs are divided according to the packet protocol type, for example, IPv4 and IPv6 belong to different VLANs.
Subnet-based VLAN: VLANs are divided according to IP address segments, for example, 192.168.1.0/24 belongs to VLAN 100, and 192.168.2.0/24 belongs to VLAN 200.
2. How VLANs improve network security and efficiency
1. Improving network security
(1) Isolating different departments or user groups
For example, the company's finance department, R&D department, and marketing department belong to different VLANs, and they are not allowed to access each other by default to prevent unauthorized data access.
(2) Preventing broadcast storms
In a normal LAN, broadcast data will spread to the entire network, while VLAN limits the scope of the broadcast domain, thereby reducing broadcast storms and improving network stability.
(3) Reduce ARP spoofing attacks
VLANs are isolated by default, making it difficult for hackers to send forged ARP packets between different VLANs, thereby reducing the risk of LAN attacks.
2. Improve network efficiency
Reduce irrelevant data traffic: For example, the printer data of the marketing department will not interfere with the server of the R&D department, avoiding bandwidth waste.
Increase data transmission speed: VLAN makes data flow more accurate, avoids irrelevant data transmission, and improves efficiency.
Optimize IT maintenance and management: VLAN makes the network structure clearer, and administrators can divide the network according to business needs without having to frequently adjust physical equipment, making maintenance easier.
3. VLAN Practice
Take Huawei eNSP (Enterprise Network Simulation Platform) as an example to introduce VLAN settings.
Currently PC1 can ping PC2:
Assign ports to VLAN:
This operation binds port 0/1 to VLAN 10, and then finds that PC2 cannot be pinged because it does not belong to Vlan10.