說明:
此Lab為Private Vlan,何謂Private Vlan?
同一個Vlan裡,還有其它的Vlan,Second Vlan用來限制同一個Vlan之間的存取。
pvlan可提高安全性、減少子網路切割與Vlan的使用率。
Private Vlan與Port關係表:
Vlan : Promiscous Community Isolated
Port : Primary Community Isolated
一、Promiscous(primary):主Vlan,如Gateway。
二、Community(community):同Vlan可互相溝通。
三、Isolated(isolate):同Vlan但不可溝通。
此Lab為Private Vlan需完成下列條件:
一、PC1、PC2隸屬於VLAN 201,彼此不能溝通
二、PC3、PC4隸屬於VLAN 202,彼此可以溝通
三、VLAN 201 下的PC 對 VLAN 202 下的PC 不能溝通
四、Primary Vlan為200
Command:
Core_SW(config)# vlan 201 建立Vlan 201
Core_SW(config-vlan)# private-vlan isolated 設定成vlan 201 為isolated模式
Core_SW(config)# vlan 202 建立Vlan 202
Core_SW(config-vlan)# private-vlan community 設定成vlan 202的community模式
Core_SW(config)# vlan 200 建立Vlan 200
Core_SW(config-vlan)# private-vlan primary 設定vlan為的primary模式
Core_SW(config-vlan)# private-vlan association 201,202 把201、202為Secund Vlan包在200裡面
Core_SW(config)# int ra fa 0/11 – 12
Core_SW(config-if-range)# sw mo ac 設定成Access Port
Core_SW(config-if-range)# sw ac vl 201 設定存取Vlan 201
Core_SW(config-if-range)# switch mode private-vlan host 設定成pvlan host端
Core_SW(config)# int ra fa 0/13 - 14
Core_SW(config-if-range)# sw mo ac 設定成Access Port
Core_SW(config-if-range)# sw ac vl 202 設定存取Vlan 202
Core_SW(config-if-range)# switch mode private-vlan host 設定成pvlan host端
Core_SW(config)# int fa 0/16
Core_SW(config-if)# sw mo ac 設定成Access Port
Core_SW(config-if)# sw ac vl 200 設定存取Vlan 200
Core_SW(config-if)# switch mode private-vlan promiscous 設定成pvlan promiscous端
Core_SW(config-if)# switchport private-vlan mapping 200 201-202 把Primary Vlan 200這支水管套用在Fa0/16
檢查指令:
show interface fa 0/16 switchport
show vlan pritvate