1. 程式人生 > >配置Primary VLAN 使其報文攜帶tag標簽通過

配置Primary VLAN 使其報文攜帶tag標簽通過

acc blog ces sta ice water process ima proc

技術分享圖片
組網要求: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標簽通過