Computer network configuration-VLAN configuration

1. The purpose of the experiment

  1. Understand the role and purpose of VLAN;
  2. Master the configuration method of VLAN division between single switch and cross switch;
  3.  Understand the process of adding and deleting VLAN tags.

2. Experimental tasks

Implement the VLAN configuration shown in the figure below in the Cisco simulator:

   Use the ping command to verify the configuration results and complete the experiment report.

2. Introduction to the experimental principle

One, VLAN concept

VLAN (virtual local area network) is a logical segmentation of network users connected to the port of the second layer switch, which is not restricted by the physical location of the network users but is based on user needs. A VLAN can be implemented in one switch or across switches. VLAN can be grouped according to the location, role, department of the network user, or according to the application and protocol used by the network user. The switch-based virtual local area network can solve the conflict domain, broadcast domain, and bandwidth problems for the local area network.

Two, VLAN tag

By default, all switch interfaces of the LAN belong to vlan1, the entire network belongs to a broadcast domain, and there is no problem with communication. How to configure VLANs in the network, that is, divide the network into different broadcast domains, and the logical structure of the network after dividing VLANs is shown in the following figure:

The trunk link of the VLAN divided across the switch VLAN

As can be seen from the above figure, the link between the switches needs to be able to transmit data of multiple VLANs at the same time. In order to enable the switch to identify data frames from different VLANs, the frame must be inserted into the header of the frame with a VLAN tag before leaving the local switch. Tag. After the data frame carries the VLAN Tag, although the transmission path passes through multiple switches, it can also be used to identify which VLAN the frame belongs to. When the switch forwards the frame to the destination host, it will delete the VLAN Tag and convert it to a standard Ethernet frame structure.

Cross-switch VLAN Tag adding and deleting process

The VLAN across switches is also called Tag VLAN or Tag VLAN, and the corresponding standard is 802.1q.

The 802.1q protocol adds a Tag field to the traditional frame format. The Tag field contains the VLAN ID of the frame. The frame format with the Tag field is shown in the following structure:

[Destination, source mac address + protocol identification + control information + data + FCS]

  • Destination and source mac address: 12 bytes.
  • Protocol ID: 2 bytes, fixed value 0x8100, indicating that the frame carries 802.1q tag information.
  • Control information: 2 bytes, 12 bits represent VID, the range is 1~4094.
  • FCS: 4 bytes.

note:

  • The database of each VLAN must be consistent.
  • The native VLAN (native VLAN) of each link connected by the switch must be consistent.
  • The interface of the switch interconnection should be set to VLAN trunk interface, namely Trunk mode.

3. Design code (or schematic diagram), simulation waveform and analysis

The configuration network structure of Cisco simulator vlan is as follows:

 

Switch 0: connect pc1 to fa0/1 of the switch, and connect pc4 and pc5 to fa0/2 and fa0/3 respectively;

Switch 2: pc6 is connected to switch fa0/3, pc2 and pc3 are connected to fa0/1 and fa0/2 respectively.

IP address: PC1:192.168.10.1

PC2:192.168.10.2

PC3: 192.168.10.3

PC4: 192.168.10.4

PC5:192.168.10.5

PC6:192.168.10.6


The configuration of the switch [Switch0] is as follows:

The configuration of the switch [Switch2] is as follows:

 

The ping test results of PC1 and PC2, PC1 and PC4 are as follows:

4. Experimental conclusions and experience

Statement explanation:

  • switchport mode trunk: means to set the interface to Trunk (relay mode) mode.
  • show int trunk: Indicates to view the trunk interface. [The trunk interface will not appear in any vlan, because the interface does not belong to any vlan]

In fact, the principle is similar to subnet division, but it is carried out on different switches. You can compare the article: Computer Network Configuration-Subnet Division

Guess you like

Origin blog.csdn.net/XZ_ROU/article/details/112870943