The Chinese name of a VLAN (Virtual Local Area Network) is "Virtual LAN ". VLAN is a new data exchange technology that logically divides LAN devices into network segments to implement virtual working groups. This emerging technology is mainly used in vswitches and routers, but mainstream applications are still in vswitches. However, not all vswitches have this function. Only the layer-3 or above vswitches of the VLAN Protocol have this function. You can view the specification of the corresponding vswitch to learn about this function.
VLAN (Virtual Local Area Network) has many purposes. By understanding the nature of a VLAN, you can know where the VLAN is actually located.
First, you must know that both 192.168.1.2/30 and 192.168.1.6/30 belong to different CIDR blocks and must be accessed through a vro. All CIDR blocks of different CIDR blocks must access each other through a vro. Second, a VLAN is essentially a network segment. It is called a virtual LAN because it is a network segment created under the virtual router interface.
The following is a description. For example, a vro has only one port for terminal connection (of course, this is basically impossible, but it is simplified as an example). The port is allocated with the address 192.168.1.1/24. However, since the company has two departments, one sales department and one Planning Department, each department requires a separate subnet with a separate server. Of course, it can be divided into 192.168.1.0 -- 127/25, 192.168.1.128 -- 255/25. However, only one IP address can be allocated to the physical port of the router. How can we identify different network segments? This allows you to create two sub-interfaces under this physical port-logical interface implementation.
For example, the logic interface F0/0.1 assigns an IP address 192.168.1.1/25 for the sales department, while F0/0.2 assigns an IP address 192.168.1.129/25 for the Planning Department. In this way, the functions of two logical interfaces are implemented using a physical port, so that only one network segment can be divided, extended to the scenario where two or more network segments can be divided. Because these CIDR blocks are created under logical interfaces, they are called virtual LAN VLANs.
This describes the purpose of VLAN at the vro level. Third, the purpose of VLAN is described at the vswitch level.
In reality, different network segments must be divided for many reasons. For example, there are only two CIDR blocks: Sales Department and Planning Department. Then, you can simply connect all the sales department to a vswitch, access a port of the vro, connect all the planning departments to a vswitch, and then access a vro port. This is LAN. however, as mentioned above, if the router is an interface used for the terminal, the two switches must access the interface of the same router. At this time, if you want to keep the original network segment division, you must use the sub-interface of the router to create a VLAN.
Similarly, for example, if you want two vswitches to have different network segments for each port on each vswitch, You can provide several router interfaces even if you have several network segments. At this time, although the vro physical interface can define which network segment this interface can connect to, at the vswitch level, it cannot distinguish which port belongs to which network segment, the only way to achieve differentiation is to divide VLANs. When VLAN is used, the network segment of the terminal of a vswitch port can be distinguished.
In summary, when at least one of the ports on a vswitch belongs to different CIDR blocks, when one physical port of the vro needs to connect two or more CIDR blocks, this is the purpose of a VLAN when it is used.
VLAN is a logical subnet built on a physical network. Therefore, creating a VLAN requires a network device that supports VLAN technology. When different VLANs in the network need to communicate with each other and support routing, you need to add a routing device-to implement the routing function, you can use a router, you can also use a layer-3 switch. The number of users is also strictly limited.