• 全部
  • 经验案例
  • 典型配置
  • 技术公告
  • FAQ
  • 漏洞说明
  • 全部
  • 全部
  • 大数据引擎
  • 知了引擎
产品线
搜索
取消
案例类型
发布者
是否解决
是否官方
时间
搜索引擎
匹配模式
高级搜索

private vlan

2022-01-11提问
  • 0关注
  • 1收藏,1176浏览
粉丝:0人 关注:0人

问题描述:

端口如果设置成 port private-vlan 2 trunk secondary或port private-vlan 10 trunk promiscuous意味着该端口会让 primary vlan 和secondary vlan都带tag通过端口,这样的话trunk 端口本身就能实现,为啥还要设成private vlan(非trunk private 可以满足vlan 数量不够,上下行vlan互相独立),private vlan里的trunk 具体应用在什么场景下,有大神能举例说明吗?手册上貌似没提到在哪些场景下会用到

组网及组网描述:


3 个回答
粉丝:111人 关注:1人

参考典型二 典型案例三,

Private VLAN典型配置举例二

1. 组网需求

·     Device B上的VLAN 5和VLAN 10为Primary VLAN,其上行端口Ten-GigabitEthernet1/0/1需要允许VLAN 5和VLAN 10的报文携带VLAN Tag通过。

·     Device B的下行端口Ten-GigabitEthernet1/0/2允许Secondary VLAN 2通过,Ten-GigabitEthernet1/0/3允许Secondary VLAN 3通过,VLAN 2和VLAN 3映射到Primary VLAN 5。

·     Device B的下行端口Ten-GigabitEthernet1/0/6允许Secondary VLAN 6通过,Ten-GigabitEthernet1/0/8允许Secondary VLAN 8通过,VLAN 6和VLAN 8映射到Primary VLAN 10。

·     从Device A看,下接的Device B只有VLAN 5和VLAN 10。

2. 组网图

图2-3 组网图

 

3. 配置步骤

(1)     配置Device B

配置VLAN 5和VLAN 10为Primary VLAN。

<DeviceB> system-view

[DeviceB] vlan 5

[DeviceB-vlan5] private-vlan primary

[DeviceB-vlan5] quit

[DeviceB] vlan 10

[DeviceB-vlan10] private-vlan primary

[DeviceB-vlan10] quit

创建Secondary VLAN 2、3、6、8。

[DeviceB] vlan 2 to 3

[DeviceB] vlan 6

[DeviceB-vlan6] quit

[DeviceB] vlan 8

[DeviceB-vlan8] quit

配置上行端口Ten-GigabitEthernet1/0/1VLAN 5VLAN 10中工作在trunk promiscuous模式。

[DeviceB] interface ten-gigabitethernet 1/0/1

[DeviceB-Ten-GigabitEthernet1/0/1] port private-vlan 5 10 trunk promiscuous

[DeviceB-Ten-GigabitEthernet1/0/1] quit

将下行端口Ten-GigabitEthernet1/0/2加入VLAN 2Ten-GigabitEthernet1/0/3加入VLAN 3,并配置他们工作在host模式。

[DeviceB] interface ten-gigabitethernet 1/0/2

[DeviceB-Ten-GigabitEthernet1/0/2] port access vlan 2

[DeviceB-Ten-GigabitEthernet1/0/2] port private-vlan host

[DeviceB-Ten-GigabitEthernet1/0/2] quit

[DeviceB] interface ten-gigabitethernet 1/0/3

[DeviceB-Ten-GigabitEthernet1/0/3] port access vlan 3

[DeviceB-Ten-GigabitEthernet1/0/3] port private-vlan host

[DeviceB-Ten-GigabitEthernet1/0/3] quit

配置Primary VLAN 5Secondary VLAN 23间的映射关系。

[DeviceB] vlan 5

[DeviceB-vlan5] private-vlan secondary 2 to 3

[DeviceB-vlan5] quit

将下行端口Ten-GigabitEthernet1/0/6加入VLAN 6Ten-GigabitEthernet1/0/8加入VLAN 8,并配置它们工作在host模式。

[DeviceB] interface ten-gigabitethernet 1/0/6

[DeviceB-Ten-GigabitEthernet1/0/6] port access vlan 6

[DeviceB-Ten-GigabitEthernet1/0/6] port private-vlan host

[DeviceB-Ten-GigabitEthernet1/0/6] quit

[DeviceB] interface ten-gigabitethernet 1/0/8

[DeviceB-Ten-GigabitEthernet1/0/8] port access vlan 8

[DeviceB-Ten-GigabitEthernet1/0/8] port private-vlan host

[DeviceB-Ten-GigabitEthernet1/0/8] quit

配置Primary VLAN 10Secondary VLAN 68间的映射关系。

[DeviceB] vlan 10

[DeviceB-vlan10] private-vlan secondary 6 8

[DeviceB-vlan10] quit

(2)     配置Device A

创建VLAN 5VLAN 10

[DeviceA] vlan 5

[DeviceA-vlan5] quit

[DeviceA] vlan 10

[DeviceA-vlan10] quit

配置端口Ten-GigabitEthernet1/0/1Hybrid端口,并允许VLAN 5VLAN 10携带Tag通过。

[DeviceA] interface ten-gigabitethernet 1/0/1

[DeviceA-Ten-GigabitEthernet1/0/1] port link-type hybrid

[DeviceA-Ten-GigabitEthernet1/0/1] port hybrid vlan 5 10 tagged

[DeviceA-Ten-GigabitEthernet1/0/1] quit

4. 显示与验证

显示Device B上的Primary VLAN 5配置情况(Primary VLAN 10的显示结果类似,这里不再列出)。

[DeviceB] display private-vlan 5

 Primary VLAN ID: 5

 Secondary VLAN ID: 2-3

 

 VLAN ID: 5

 VLAN type: Static

 Private VLAN type: Primary

 Route interface: Not configured

 Description: VLAN 0005

 Name: VLAN 0005

 Tagged   ports:

    Ten-GigabitEthernet1/0/1

 Untagged ports:

    Ten-GigabitEthernet1/0/2          Ten-GigabitEthernet1/0/3

 

 VLAN ID: 2

 VLAN type: Static

 Private VLAN type: Secondary

 Route interface: Not configured

 Description: VLAN 0002

 Name: VLAN 0002

 Tagged   ports:

    Ten-GigabitEthernet1/0/1

 Untagged ports:

    Ten-GigabitEthernet1/0/2

 

 VLAN ID: 3

 VLAN type: Static

 Private VLAN type: Secondary

 Route interface: Not configured

 Description: VLAN 0003

 Name: VLAN 0003

 Tagged   ports:

    Ten-GigabitEthernet1/0/1

 Untagged ports:

    Ten-GigabitEthernet1/0/3

1.5  Private VLAN典型配置举例三

1. 组网需求

·     Device A上的VLAN 10和VLAN 20为Primary VLAN,上行端口Ten-GigabitEthernet1/0/5需要允许VLAN 10和VLAN 20的报文携带VLAN Tag通过。

·     Device A上的VLAN 11、12、21、22为Secondary VLAN,下行端口Ten-GigabitEthernet1/0/2允许VLAN 11和VLAN 21的报文携带VLAN Tag通过,下行端口Ten-GigabitEthernet1/0/1允许VLAN 22通过,下行端口Ten-GigabitEthernet1/0/3允许VLAN 12通过。

·     Secondary VLAN 11和Secondary VLAN 12映射到Primary VLAN 10;Secondary VLAN 21和Secondary VLAN 22映射到Primary VLAN 20。

2. 组网图

图2-4 组网图

 

3. 配置步骤

(1)     配置Device A

配置VLAN 10和VLAN 20为Primary VLAN。

<DeviceA> system-view

[DeviceA] vlan 10

[DeviceA-vlan10] private-vlan primary

[DeviceA-vlan10] quit

[DeviceA] vlan 20

[DeviceA-vlan20] private-vlan primary

[DeviceA-vlan20] quit

创建VLAN 11、12、21、22。

[DeviceA] vlan 11 to 12

[DeviceA] vlan 21 to 22

配置Primary VLAN 10Secondary VLAN 1112间的映射关系。

[DeviceA] vlan 10

[DeviceA-vlan10] private-vlan secondary 11 12

[DeviceA-vlan10] quit

配置Primary VLAN 20Secondary VLAN 2122间的映射关系。

[DeviceA] vlan 20

[DeviceA-vlan20] private-vlan secondary 21 22

[DeviceA-vlan20] quit

配置上行端口Ten-GigabitEthernet1/0/5VLAN 10VLAN 20中工作在trunk promiscuous模式。

[DeviceA] interface ten-gigabitethernet 1/0/5

[DeviceA-Ten-GigabitEthernet1/0/5] port private-vlan 10 20 trunk promiscuous

[DeviceA-Ten-GigabitEthernet1/0/5] quit

将下行端口Ten-GigabitEthernet1/0/1加入VLAN 22,并配置工作在host模式。

[DeviceA] interface ten-gigabitethernet 1/0/1

[DeviceA-Ten-GigabitEthernet1/0/1] port access vlan 22

[DeviceA-Ten-GigabitEthernet1/0/1] port private-vlan host

[DeviceA-Ten-GigabitEthernet1/0/1] quit

将下行端口Ten-GigabitEthernet1/0/3加入VLAN 12,并配置工作在host模式。

[DeviceA] interface ten-gigabitethernet 1/0/3

[DeviceA-Ten-GigabitEthernet1/0/3] port access vlan 12

[DeviceA-Ten-GigabitEthernet1/0/3] port private-vlan host

[DeviceA-Ten-GigabitEthernet1/0/3] quit

配置下行端口Ten-GigabitEthernet1/0/2VLAN 11VLAN 21中工作在trunk secondary模式。

[DeviceA] interface ten-gigabitethernet 1/0/2

[DeviceA-Ten-GigabitEthernet1/0/2] port private-vlan 11 21 trunk secondary

[DeviceA-Ten-GigabitEthernet1/0/2] quit

(2)     配置Device B

创建VLAN 11VLAN 21

<DeviceB> system-view

[DeviceB] vlan 11

[DeviceB-vlan11] quit

[DeviceB] vlan 21

[DeviceB-vlan21] quit

配置端口Ten-GigabitEthernet1/0/2Hybrid端口,并允许VLAN 11VLAN 21携带Tag通过。

[DeviceB] interface ten-gigabitethernet 1/0/2

[DeviceB-Ten-GigabitEthernet1/0/2] port link-type hybrid

[DeviceB-Ten-GigabitEthernet1/0/2] port hybrid vlan 11 21 tagged

[DeviceB-Ten-GigabitEthernet1/0/2] quit

将端口Ten-GigabitEthernet1/0/4加入VLAN 11

[DeviceB] interface ten-gigabitethernet 1/0/4

[DeviceB-Ten-GigabitEthernet1/0/4] port access vlan 11

[DeviceB-Ten-GigabitEthernet1/0/4] quit

将端口Ten-GigabitEthernet1/0/3加入VLAN 21

[DeviceB] interface ten-gigabitethernet 1/0/3

[DeviceB-Ten-GigabitEthernet1/0/3] port access vlan 21

[DeviceB-Ten-GigabitEthernet1/0/3] quit

(3)     配置Device C

创建VLAN 10VLAN 20

<DeviceC> system-view

[DeviceC] vlan 10

[DeviceC-vlan10] quit

[DeviceC] vlan 20

[DeviceC-vlan20] quit

配置端口Ten-GigabitEthernet1/0/5Hybrid端口,并允许VLAN 10VLAN 20携带Tag通过。

[DeviceC] interface ten-gigabitethernet 1/0/5

[DeviceC-Ten-GigabitEthernet1/0/5] port link-type hybrid

[DeviceC-Ten-GigabitEthernet1/0/5] port hybrid vlan 10 20 tagged

[DeviceC-Ten-GigabitEthernet1/0/5] quit

4. 显示与验证

显示Device A上Primary VLAN 10的配置情况。

[DeviceA] display private-vlan 10

 Primary VLAN ID: 10

 Secondary VLAN ID: 11-12

 

 VLAN ID: 10

 VLAN type: Static

 Private-vlan type: Primary

 Route interface: Not configured

 Description: VLAN 0010

 Name: VLAN 0010

 Tagged   ports:

    Ten-GigabitEthernet1/0/2          Ten-GigabitEthernet1/0/5

 Untagged ports:

    Ten-GigabitEthernet1/0/3

 

 VLAN ID: 11

 VLAN type: Static

 Private-vlan type: Secondary

 Route interface: Not configured

 Description: VLAN 0011

 Name: VLAN 0011

 Tagged   ports:

    Ten-GigabitEthernet1/0/2          Ten-GigabitEthernet1/0/5

 Untagged ports: None

 

VLAN ID: 12

 VLAN type: Static

 Private-vlan type: Secondary

 Route interface: Not configured

 Description: VLAN 0012

 Name: VLAN 0012

 Tagged   ports:

    Ten-GigabitEthernet1/0/5

 Untagged ports:

    Ten-GigabitEthernet1/0/3

显示Device A上Primary VLAN 20的配置情况。

[DeviceA] display private-vlan 20

 Primary VLAN ID: 20

 Secondary VLAN ID: 21-22

 

 VLAN ID: 20

 VLAN type: Static

 Private-vlan type: Primary

 Route interface: Not configured

 Description: VLAN 0020

 Name: VLAN 0020

 Tagged   ports:

    Ten-GigabitEthernet1/0/2          Ten-GigabitEthernet1/0/5

 Untagged ports:

    Ten-GigabitEthernet1/0/1

 

 VLAN ID: 21

 VLAN type: Static

 Private-vlan type: Secondary

 Route interface: Not configured

 Description: VLAN 0021

 Name: VLAN 0021

 Tagged   ports:

    Ten-GigabitEthernet1/0/2          Ten-GigabitEthernet1/0/5

 Untagged ports: None

 

 VLAN ID: 22

 VLAN type: Static

 Private-vlan type: Secondary

 Route interface: Not configured

 Description: VLAN 0022

 Name: VLAN 0022

 Tagged   ports:

    Ten-GigabitEthernet1/0/5

 Untagged ports:

    Ten-GigabitEthernet1/0/1

暂无评论

粉丝:0人 关注:0人

您发的早就看过,貌似trunk 也能用为啥还要用private

暂无评论

zhiliao_DfBLR 知了小白
粉丝:0人 关注:0人

我咨询一下配置三案例  我在Device c上开启DHCP  下面的PC为啥获取不到IP地址

暂无评论

编辑答案

你正在编辑答案

如果你要对问题或其他回答进行点评或询问,请使用评论功能。

分享扩散:

提出建议

    +

亲~登录后才可以操作哦!

确定

亲~检测到您登陆的账号未在http://hclhub.h3c.com进行注册

注册后可访问此模块

跳转hclhub

你的邮箱还未认证,请认证邮箱或绑定手机后进行当前操作

举报

×

侵犯我的权益 >
对根叔社区有害的内容 >
辱骂、歧视、挑衅等(不友善)

侵犯我的权益

×

泄露了我的隐私 >
侵犯了我企业的权益 >
抄袭了我的内容 >
诽谤我 >
辱骂、歧视、挑衅等(不友善)
骚扰我

泄露了我的隐私

×

您好,当您发现根叔知了上有泄漏您隐私的内容时,您可以向根叔知了进行举报。 请您把以下内容通过邮件发送到pub.zhiliao@h3c.com 邮箱,我们会尽快处理。
  • 1. 您认为哪些内容泄露了您的隐私?(请在邮件中列出您举报的内容、链接地址,并给出简短的说明)
  • 2. 您是谁?(身份证明材料,可以是身份证或护照等证件)

侵犯了我企业的权益

×

您好,当您发现根叔知了上有关于您企业的造谣与诽谤、商业侵权等内容时,您可以向根叔知了进行举报。 请您把以下内容通过邮件发送到 pub.zhiliao@h3c.com 邮箱,我们会在审核后尽快给您答复。
  • 1. 您举报的内容是什么?(请在邮件中列出您举报的内容和链接地址)
  • 2. 您是谁?(身份证明材料,可以是身份证或护照等证件)
  • 3. 是哪家企业?(营业执照,单位登记证明等证件)
  • 4. 您与该企业的关系是?(您是企业法人或被授权人,需提供企业委托授权书)
我们认为知名企业应该坦然接受公众讨论,对于答案中不准确的部分,我们欢迎您以正式或非正式身份在根叔知了上进行澄清。

抄袭了我的内容

×

原文链接或出处

诽谤我

×

您好,当您发现根叔知了上有诽谤您的内容时,您可以向根叔知了进行举报。 请您把以下内容通过邮件发送到pub.zhiliao@h3c.com 邮箱,我们会尽快处理。
  • 1. 您举报的内容以及侵犯了您什么权益?(请在邮件中列出您举报的内容、链接地址,并给出简短的说明)
  • 2. 您是谁?(身份证明材料,可以是身份证或护照等证件)
我们认为知名企业应该坦然接受公众讨论,对于答案中不准确的部分,我们欢迎您以正式或非正式身份在根叔知了上进行澄清。

对根叔社区有害的内容

×

垃圾广告信息
色情、暴力、血腥等违反法律法规的内容
政治敏感
不规范转载 >
辱骂、歧视、挑衅等(不友善)
骚扰我
诱导投票

不规范转载

×

举报说明