配置Primary VLAN 使其报文携带tag标签通过

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了配置Primary VLAN 使其报文携带tag标签通过相关的知识,希望对你有一定的参考价值。

技术图片
组网要求:Device B上的vlan 5 和vlan 10 为primary vlan ,其上行端口g1/0/1允许vlan 5 和vlan 10 的报文携带vlan tag 通过;Device B的下行端口g1/0/2允许 Secondary vlan 2 通过,g1/0/3 允许Secondary vlan 3 通过,vlan 2 和vlan 3映射到Primary vlan 5。Device B 的下行端口g1/0/6允许Secondary vlan 6 通过,g1/0/8允许Secondary vlan 8通过, vlan 6 和vlan 8映射到 Primary vlan 10 。从Device A 看,下接的Device B只有 VLAN 5 和VLAN 10。
配置步骤如下:
1.配置DEVICE B,配置vlan 5和vlan 10 为primary vlan.
<DeviceB>sys
[DeviceB]vlan 5
[DeviceB-vlan5]private-vlan primary
[DeviceB-vlan5]quit
[DeviceB]vlan 10
[DeviceB-vlan10]private-vlan primary
[DeviceB-vlan10]quit

2.创建Secondary vlan 2、3、6、8.
[DeviceB]vlan 2 to 3
[DeviceB]vlan 6
[DeviceB-vlan6]quit
[DeviceB]vlan 8
[DeviceB-vlan8]quit

3.配置上行端口g1/0/1在vlam=n 5 和vlan 10中工作在trunk promiscuous 模式。
[DeviceB]int g1/0/1
[DeviceB-giabithethernet1/0/1]port private-vlan 5 10 tr pro
[DeviceB-giabithethernet1/0/1]quit

4.将下行端口g1/0/2加入vlan2,g1/0/3加入vlan 3,并配置他们工作在host 模式。
[DeviceB]int g1/0/2
[DeviceB-giabithethernet1/0/2]port access valn 2
[DeviceB-giabithethernet1/0/2]port private-valn host
[DeviceB-giabithethernet1/0/2]quit
[DeviceB]int g1/0/3
[DeviceB-giabithethernet1/0/3]port access valn 3
[DeviceB-giabithethernet1/0/3]port private-valn host
[DeviceB-giabithethernet1/0/3]quit

5.配置Primary vlan 5 和secondary vlan 2、3间的映射关系。
[DeviceB]vlan 5
[DeviceB-vlan5]private-vlan secondary 2 to 3
[DeviceB-vlan5]quit

  1. 将下行端口g1/0/6加入vlan6,g1/0/8加入vlan 8,并配置他们工作在host 模式。
    [DeviceB]int g1/0/6
    [DeviceB-giabithethernet1/0/6]port access valn 6
    [DeviceB-giabithethernet1/0/6]port private-valn host
    [DeviceB-giabithethernet1/0/6]quit
    [DeviceB]int g1/0/8
    [DeviceB-giabithethernet1/0/8]port access valn 8
    [DeviceB-giabithethernet1/0/8]port private-valn host
    [DeviceB-giabithethernet1/0/8]quit

  2. 配置Primary vlan 10和secondary vlan 6、8间的映射关系。
    [DeviceB]vlan 10
    [DeviceB-vlan10]private-vlan secondary 6 to 8
    [DeviceB-vlan10]quit

8.配置Device A 。创建VLAN 5和 VLAN 10.
[DeviceB]vlan 5
[DeviceB-vlan5]quit
[DeviceB]vlan 10
[DeviceB-vlan10]quit

  1. 配置端口g1/0/1为Hybrid端口,并允许 VLAN 5和 VLAN 10携带 Tag通过.
    [DeviceB]int g1/0/1
    [DeviceB-giabithethernet1/0/1]port link-type hybrid
    [DeviceB-giabithethernet1/0/1]port hybrid valn 5 10 tagged

[DeviceB-giabithethernet1/0/1]quit

10.显示与验证。

以上是关于配置Primary VLAN 使其报文携带tag标签通过的主要内容,如果未能解决你的问题,请参考以下文章

Primary vlan

HCL模拟器 Primary VLAN 及 Super VLAN

VLAN通信原理

VLAN配置

VLan与交换机端口模式Access/Trunk/Hybrid

Primary VLAN