Hybrid模式是交换机端口的一种配置模式,它允许端口同时携带多个VLAN(虚拟局域网)的流量。Hybrid端口可以指定哪些VLAN的数据帧被打上标签(tagged)和哪些VLAN的数据帧在发送时去除标签(untagged)。这种配置增加了网络的灵活性和安全性,因为管理员可以根据需要控制不同VLAN之间的通信。
Hybrid端口与Trunk端口类似,但在发送数据时,Hybrid端口具有解除多VLAN标签的功能,而Trunk端口通常只允许缺省VLAN的报文发送时不打标签。
SW1配置
[SW1]vlan batch 10 20 100
Info: This operation may take a few seconds. Please wait for a moment...done.
[SW1]interface GigabitEthernet 0/0/1
[SW1-GigabitEthernet0/0/1]port link-type hybrid
[SW1-GigabitEthernet0/0/1]port hybrid pvid vlan 10
[SW1-GigabitEthernet0/0/1]port hybrid untagged vlan 10 100
[SW1-GigabitEthernet0/0/1]q
[SW1]interface GigabitEthernet 0/0/2
[SW1-GigabitEthernet0/0/2]port link-type hybrid
[SW1-GigabitEthernet0/0/2]port hybrid pvid vlan 20
[SW1-GigabitEthernet0/0/2]port hybrid untagged vlan 20 100
[SW1-GigabitEthernet0/0/2]q
[SW1]interface GigabitEthernet 0/0/3
[SW1-GigabitEthernet0/0/3]port link-type hybrid
[SW1-GigabitEthernet0/0/3]port hybrid tagged vlan 10 20 100
[SW1-GigabitEthernet0/0/3]q
SW2配置
[SW2]vlan batch 10 20 100
Info: This operation may take a few seconds. Please wait for a moment...done.
[SW2]interface GigabitEthernet 0/0/1
[SW2-GigabitEthernet0/0/1]port link-type hybrid
[SW2-GigabitEthernet0/0/1]port hybrid pvid vlan 100
[SW2-GigabitEthernet0/0/1]port hybrid untagged vlan 10 20 100
[SW2-GigabitEthernet0/0/1]q
[SW2]interface GigabitEthernet 0/0/3
[SW2-GigabitEthernet0/0/3]port link-type hybrid
[SW2-GigabitEthernet0/0/3]port hybrid tagged vlan 10 20 100
[SW2-GigabitEthernet0/0/3]q