IELAB laboratory network switches understand Huawei Interface: Access, Trunk, Hybrid three modes

Let's look at what characteristics are three types:
Access type of port can belong to one VLAN, ports for connecting PCs;
Trunk may allow a plurality of types of ports by VLAN, may receive and transmit a plurality of VLAN packets, typically a connection port between the switches;
Hybrid port can allow multiple VLAN, can receive and transmit packets of a plurality of VLAN, the switch can be used to connect, may be used connected to the user's computer.
We all know that different vlan of data during the time forward, will add vlan identifier in the packet, what we call tag. tag message structure changes is after the source and destination mac address mac address, information 4bytes vlan added, i.e. vlan tag header. untag is common Ethernet network card message, ordinary PC that can identify such messages to communicate.
Hybrid and Trunk port when data is received, the processing method is the same, the only difference is that the transmission data: Hybrid port allows multiple VLAN packets without tags send, and Trunk port only allows the default VLAN the message is sent without tags.
Access port only belongs to one VLAN, its default VLAN is it in the VLAN, do not set; and Hybrid ports and Trunk ports belong to multiple VLAN, so a default VLAN ID. If the default VLAN ID of the port, when the port receiving the packet without a VLAN tag, the packet is forwarded to the default VLAN ports belong; When sending the packet carries a VLAN tag, if the the same as the default VLAN ID of port packet a VLAN ID, the system will remove the packet VLAN tag, and then sends the packet. The Trunk Hybrid port or ports, and using Hybrid Trunk port or ports must pay attention to multiple VLAN packet transmission: the default local port and VLAN ID (PVID port) on the end of the port to be consistent. Hybrid application port of considerable flexibility to meet special application requirements. Such requirements are mostly on the switch can not be issued access control rules, using the processing mechanism Hybrid port transceivers packets when to complete the two-story access control between PC on the same network segment. Huawei device will default vlan known as: Pvid vlan, Cisco equipment called: Native vlan.
Access received message, receives a packet, determines whether the VLAN information: if it is not marked. PVID and forwarding exchange, if directly discarded, Access transmission packets, the packet VLAN information peeling directly sent out.
Trunk receives the message, receive a message, determine whether the VLAN information: If you have not marked PVID port, and exchange forwards, to determine if the trunk port VLAN is allowed to enter the data: If you forward, or else discarded; Trunk transmitting packets, comparing the PVID packets to be transmitted and VLAN information, if it is equal peel VLAN information, retransmission, if not equal, direct transmission.
hybrid received message, receives a packet, determines whether the VLAN information: If no port is marked PVID, and switching and forwarding, if it is determined that the data is allowed hybrid port VLAN entry: If the forward, otherwise, discard (in this case the ports are arranged untag not considered, untag configuration takes effect only when the transmission of packets);
Hybrid transmission packets, determining the properties of the VLAN in the local port, if the release is untag VLAN information, and then send, if the tag is transmitted directly.

Here Insert Picture Description
附加一个小实验,要求vlan2可以和vlan4通信。(仅hybird配置部分)
Sw1:
[Huawei]interface g0/0/2
[Huawei-GigabitEthernet0/0/2]port link-type hybrid
[Huawei-GigabitEthernet0/0/2]port hybrid untagged vlan 2 4
[Huawei-GigabitEthernet0/0/2]port hybrid pvid vlan 4
Sw2:
[Huawei]interface g0/0/1
[Huawei-GigabitEthernet0/0/1]port link-type hybrid
[Huawei-GigabitEthernet0/0/1]port hybrid untagged vlan 2 4
[Huawei-GigabitEthernet0/0/1]port hybrid pvid vlan 4
[Huawei-GigabitEthernet0/0/1]quit
[Huawei]interface g0/0/2
[Huawei-GigabitEthernet0/0/2]port link-type hybrid
[Huawei-GigabitEthernet0/0/2]port hybrid untagged vlan 2 4
[Huawei-GigabitEthernet0/0/2]port hybrid pvid vlan 2
[Huawei-GigabitEthernet0/0/2]quit

TA: Madina

Guess you like

Origin blog.csdn.net/spccie/article/details/93739009