The operation idea of access and trunk link to tag processing

The operation idea of ​​access and trunk link to tag processing
Environment: All machines are turned on, Pc1 is connected to vlan10, LW1 0/0/1 is connected to LW2 by access, other PCs default to vlan1, and LW2 0/0/1 is connected to LW1 by access, PC1 and PC4 can be connected.
Thinking: Actually, two switches It is not normal to use access to connect, and different vlans should be unsuccessful, but they can be connected.
Explain that when PC1 sends data to LW1 0/0/2, the port will check the PVID and find that the data is sent by vlan10. When sending, it will check the mac The address table and port, LW1 0/0/1 is linked by access, no need to tag, the data will be sent directly to LW2 0/0/1, in the same way, it will be sent directly to PC4, without tagging, send directly
< LW1>sys
Enter system view, return user view with Ctrl+Z.
[LW1]vlan 10 Create vlan10
[LW1-vlan10]q
[LW1]interface gi 0/0/2
[LW1-GigabitEthernet0/0/2]port link- type access Set port 0/0/2 to access mode and add vlan10 (the terminal and switch must be connected in access mode)
[LW1-GigabitEthernet0/0/2]port default vlan 10
[LW1-GigabitEthernet0/0/2]q
[LW1]interface gi0/0/1
[LW1-GigabitEthernet0/0/1]port link-type access Set port 0/0/1 to access mode and add vlan10 (this step is an experiment)
[LW1-GigabitEthernet0/0/1]port default vlan 10

LW2
<LW2>sys
Enter system view, return user view with Ctrl+Z.
[LW2]interface gi0/0/1
[LW2-GigabitEthernet0/0/1]port link-type access Set port 0/0/1 as access mode, add vlan1 (default)
[LW2-GigabitEthernet0/0/1]port default vlan 1
The operation idea of ​​access and trunk link to tag processing

The operation idea of ​​access and trunk link to tag processing
Environment:
On the basis of solution 1, change the connection between switches to trunk link, PC1 and PC2 will not be able to communicate
. Note:
PC1 sends data to LW1 0/0/2, the port will check that the data is sent by vlan10, and access is not opened. When sending the label, it will check the mac address table and port, and find that vlan10 corresponds to port 0/0/1, and 0/0/1 is a trunk link, you need to label vlan10, and when it reaches LW2 0/0/1, LW2 There is no path for vlan10, so the data
The operation idea of ​​access and trunk link to tag processing
environment will be discarded directly: On the basis of scheme 2, add LW2 0/0/3 and 0/0/1 to vlan10 to make it all together
Description:
Similarly, when the data reaches 0/0 of LW2 When the interface is 0/1, this interface is a trunk connection and needs to be labeled, but it finds that the label vlan10 is already attached when the data is received, so it will pass directly. LW2 checks the mac-address and learns that the export corresponding to vlan10 is 0/ 0/3, sent to this port, PC4 can receive the data, the return path is the same, so it can be spelled out.
The operation idea of ​​access and trunk link to tag processing
Environment:
Port 0/0/2 of switch 1 and port 0/0/3 of switch 2 belong to valn10, that is, PC1 and PC4 belong to vlan10, set LW1 0/0/1 port to LW2 as access (there may be an operation error , forget to match), set LW2 0/0/1 to connect LW1 as trunk, and do not configure PC2 and PC3.
illustrate:
PC1 sends data, LW1 0/0/2 will query PVID (display port vlan) when receiving data, that is, the vlan number of the source, and the switch will query the mac address table (display mac-address vlan xx), that is, the outgoing port of this vlan is in Where, because the two ports of LW1 are both access connections and have no labels, when sent to 0/0/1 of LW2, LW2 0/0/1 finds that the received data has no labels, and its own port is a trunk connection, it must be To label, you can only label your own default label vlan1 (all ports belong to vlan1 by default), and LW2 also queries its own mac address. Only PC1 connected to 0/0/2 belongs to vlan1, so the data will be sent to PC3 by mistake. , the PC4 that received the information did not receive the data

Conclusion
The difference between Access and Trunk links:
#The connected devices are different;
access, generally connected to terminal devices;
trunk, generally connected to switch devices;
#supported VLANs are different;
access, can only belong to one VLAN;
trunk, Multiple VLANs can be supported at the same time;
#Operations for data are different
access:
for outgoing data, it is not tagged;
for inbound data, it is not tagged;
trunk:
For outbound data, it must be Need to be tagged;
for incoming data, #If the
received data is tagged,
& if the receiving port allows the vlan, then receive it directly;
& if the receiving port does not allow the vlan, then Directly discard;
#If the received data does not carry a label, the vlan number
indicated by the PVID on the trunk port will be used to label the data; Note: The default PVID on the trunk link is 1


Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325298037&siteId=291194637