Chinaunix首页 | 论坛 | 博客
  • 博客访问: 2073740
  • 博文数量: 433
  • 博客积分: 4775
  • 博客等级: 上校
  • 技术积分: 8054
  • 用 户 组: 普通用户
  • 注册时间: 2009-10-19 16:15
文章存档

2014年(9)

2013年(20)

2012年(77)

2011年(323)

2009年(4)

分类: 系统运维

2011-10-20 08:35:20

PVLAN中,除了上节介绍的两类主机端口外,还有一种在主VLAN中的混杂模式端口。配置二层接口作为PVLAN混杂端口的步骤如表8-22所示。

8-22  配置二层接口作为PVLAN混杂端口的步骤

 

命令

用途

Step 1 

Switch(config)# interface type slot/port

选择要配置的LAN接口

Step 2 

Switch(config-if)# switchport

配置该端口为二层交换模式。

在你再次键入带有其他关键字的switchport命令前,你必须键入一次不带任何关键字的switchport命令,以配置LAN端口为二层接口

仅在你还没有在端口上键入switchport命令时需要执行步此

Step 3 

Switch(config-if)# switchport mode private-vlan {host | promiscuous}

配置二层端口作为PVLAN混杂端口

Switch(config-if)# no switchport mode private-vlan

清除PVLAN端口配置

Step 4 

Switch(config-if)# switchport private-vlan mapping primary_vlan_ID {secondary_vlan_list | add secondary_vlan_list | remove secondary_vlan_list}

镜像PVLAN混杂端口到主VLAN以及选择的从VLAN上。

如果启用了VLAN锁定,则键入VLAN名,替代VLAN ID

Switch(config-if)# no switchport private-vlan mapping

清除PVLAN混杂端口和主VLAN、从VLAN之间的所有镜像关系

Step 5 

Switch(config-if)# end

退出接口配置模式

Step 6 

Switch# show interfaces [type1 slot/port] switchport

校验以上设置

在你配置一个二层接口作为PVLAN混杂端口时,需要注意以下事项:

n         VLAN列表参数中不能包含空格,但可以包含多个以逗号分隔的条目。每个条目可以是一个单独的PVLAN ID,或者以连接符表示的VLAN ID范围。

n         如果VLAN启用了锁定功能,则在从VLAN列表中用VLAN名称来替代VLAN ID,你必须在VLAN名之间,以及连接符两端留有空格。

n         键入从VLAN列表或者使用带有add关键字的从VLAN列表可使从VLAN镜像到PVLAN混杂端口上。

使用带有remove关键字的从VLAN列表可清除从VLANPVLAN混杂端口之间的镜像关

以下示例显示如何配置二层接口fastEthernet 5/2作为一个PVLAN混杂端口,并镜像它到一个主VLAN ID202,从VLAN ID303440PVLAN中。

Switch# configure terminal

Switch(config)# interface fastethernet 5/2

Switch(config-if)# switchport mode private-vlan promiscuous

Switch(config-if)# switchport private-vlan mapping 202 303,440

Switch(config-if)# end

 

以下示例显示了上述示例的校验过程。

Switch# show interfaces fastethernet 5/2 switchport

Name: Fa5/2

Switchport: Enabled

Administrative Mode: private-vlan promiscuous

Operational Mode: down

Administrative Trunking Encapsulation: negotiate

Negotiation of Trunking: On

Access Mode VLAN: 1 (default)

Trunking Native Mode VLAN: 1 (default)

Administrative private-vlan host-association: none ((Inactive))

Administrative private-vlan mapping: 202 (VLAN0202) 303 (VLAN0303) 440 (VLAN0440)

Operational private-vlan: none

Trunking VLANs Enabled: ALL

Pruning VLANs Enabled: 2-1001

Capture Mode Disabled

本文摘自《Catalyst交换机VLANVMPS配置与管理》第八章
阅读(1197) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~