《cisco pvlan配置.docx》由会员分享,可在线阅读,更多相关《cisco pvlan配置.docx(6页珍藏版)》请在得力文库 - 分享文档赚钱的网站上搜索。
1、PVLAN即私有VLAN(Private VLAN),PVLAN采用两层VLAN隔离技术,只有上层VLAN全局可见,下层VLAN相互隔离。每个pVLAN 包含2种VLAN :主VLAN(primary VLAN)和辅助VLAN(Secondary VLAN)。辅助VLAN(Secondary VLAN)包含两种类型:隔离VLAN(isolated VLAN)和团体VLAN(community VLAN)。pVLAN中的两种接口类型:处在pVLAN中的交换机物理端口,有两种接口类型。混杂端口(Promiscuous Port)主机端口(Host Port)Catalyst3560, 45, 65
2、系列支持配置pVLAN的实例: SwitchA(config)#vlan 100 SwitchA(config-vlan)#private-vlan primary !设置主VLAN 100 SwitchA(config)#vlan 200 SwitchA(config-vlan)#private-vlan community !设置团体VLAN 200SwitchA(config)#vlan 300 SwitchA(config-vlan)#private-vlan isolated !设置隔离VLAN 300 SwitchA(config)#vlan 100SwitchA(config-v
3、lan)#private-vlan association 200,300!将辅助VLAN关联到主VLAN SwitchA(config)#interface vlan 100 SwitchA(config-if)#private-vlan mapping add 200,300 !将辅助VLAN映射到主VLAN接口,允许三层交换 SwitchA(config)# interface fastethernet 0/2 SwitchA(config-if)#switchport mode private-vlan host SwitchA(config-if)#switchport privat
4、e-vlan host-association 100 200 !2号口划入团体VLAN 200 SwitchA(config)# interface fastethernet 0/3 SwitchA(config-if)#switchport mode private-vlan host SwitchA(config-if)#switchport private-vlan host-association 100 300 !3号口划入隔离VLAN 300 SwitchA(config)# interface fastethernet 0/1 SwitchA(config-if)#switch
5、port mode private-vlan promiscuous SwitchA(config-if)#switchport private-vlan mapping 100 add 200-300 !1号口杂合模式CatOS的配置 set vlan 100 pvlan-type primary set vlan 200 pvlan-type community set vlan 300 pvlan-type isolated set pvlan 100 200 5/1 set pvlan 100 300 5/2 set pvlan mapping 100,200 15/1 set pvl
6、an mapping 100,300 15/1 /指定混杂模式的接口参考资料:关于端口隔离Switch(config)# interface gigabitethernet1/0/2Switch(config-if)# switchport protectedCatalyst 29 35系列支持网关 及共享口 不敲protected 即可通信pVLAN(Private VLAN,私用VLAN)是能够为相同VLAN内不同端口之间提供隔离的VLAN。通过隔离相同VLAN之中的网络设备之间的流量,Cisco所提出的pVLAH能够提高安全性、降低IP子网数目和降低VLAN利用率。每个PVLAN包括2种
7、VLAN:主VLAN和辅助VLAN主VLAN:主PVLAN是PVLAN中的高级VLAN.主VLAN由很多个辅助VLAN组成,且辅助VLAN属于主VLAN的相同子网.辅助VLAN:辅助VLAN是主VLAN的子代,并且映射到一个主VLAN。每台设备连接到辅助PVLANPromiscuous端口PVLAN中的全部设备进行通信.混杂端口只是主VLAN的一部分。每个混杂端口可以映射到多个辅助VLAN。混杂端口通常是路由器端口,备分服务器或者VLAN接口.辅助VLAN 包括如下两种类型:团体VLAN-如果端口属于团体VLAN,那么它就不仅能够与相同团体VLAN中的其他端口进行通信,而且还能够与PVLAN的
8、混杂端口进行通信。隔离VLAN-如果端口属于隔离VLAN,那么它只能与混杂端口进行通信.隔离VLAN端口不能与相同隔离VLAn中的其他端口进行通信.PVLAN、在配置PVALN的时候,因为只有VTP透明模式支持PVLAN,所以必须首先将交换机配置为VTP透明模式.步骤1:在开始配置PVLAN之前,首先将交换机VTP模式为透明模式.AS1(config-vlan)#vtp mode transparent步骤2:在交换机AS1,创建主Pvlan 100,团体Pvlan 101 和隔离Pvlan 102。此外,建立辅助Pvlan和主pvlan 的关联.AS1(config-vlan)#vlan 1
9、00AS1(config-vlan)#private-vlan primary /将VLAN100配置为主pVLANAS1(config-vlan)#private-vlan association 101-102 /建立辅助pVLAN与主pVLAN的关联AS1(config-vlan)#vlan 101AS1(config-vlan)#private-vlan community /将VLAN101配置为团体pVLANAS1(config-vlan)#vlan 102AS1(config-vlan)#private-vlan isolated /将VLAN102配置为隔离pVLAN步骤3:将
10、VLAN100配置为主PVLAN,并且将其映射到辅助PVLAN101 和102.AS1(config)#interface vlan 100AS1(config-if)#no shutAS1(config-if)#private-vlan mapping 101,102 /将辅助pVLAN映射到第3层VLAN接口以实现路由功能步骤4:在交换机AS1上,将主机A的接口配置为Pvlan 101的成员,将主机B的接口配置为Pvlan 102的成员.AS1(config)#interface fastEtherne t 2/3AS1(config-if)#description Host_AAS1(c
11、onfig-if)#swithportAS1(config-if)#swithport mode private-vlan host /将端口配置为主机端口AS1(config-if)#swithport private-vlan host-association 100 101 /建立第2层接口与pVLAN的关联AS1(config-if)#no shutdownAS1(config-if)#interface fastethernet 2/4AS1(config-if)#description Host_BAS1(config-if)#swithportAS1(config-if)#swithport mode private-vlan host /将端口配置为主机端口AS1(config-if)#swithport private-vlan host-association 100 102 /建立第2层接口与pVLAN的关联AS1(config-if)#no shutdown步骤5:验证私用VLAN配置,并且确认主机A不能成功ping通主机B