Private VALN 主要的目的就是要求在同一个ip子网内的主机不能随便相互访问,而同时又都可以和某一个目的主机,比如路由器、防火墙之类的通讯。 常见的应用场合是DMZ,或者ISP的个人用户群体等。

private VLAN包含primary VLAN

和secondary VLAN, 它又分为isolated 和 community 两种, isolated 只能和promiscuous 端口通讯, community内部的主机可以相互通信。

private VALN里面的端口又分三种, promiscuous port, isolated port和community port。

 

要在思科交换机上配置

首先打开这个功能

switch(config)# feature private-vlan 

各个vlan必须已经定义好,然后再把它们转换为各种private VLAN

switch(config)# vlan 5
switch(config-vlan)# private-vlan primary
switch(config-vlan)#  exit
switch(config)# vlan 100
switch(config-vlan)# private-vlan community
switch(config-vlan)# exit
switch(config)# vlan 109
switch(config-vlan)# private-vlan isolated

如果要删除private vlan,先用no provate-vlan 命令把它们改回普通vlan

定义好了,就把secondary关联到primary

进入primary vlan

switch(config)# vlan 5
switch(config-vlan)# private-vlan association 100-103, 109

你还可以用add remove 选项来编辑这个secondary valn列表。

 

然后还要配置每个端口:

对于secondary vlan里的端口,

switch(config)# interfaceethernet 1/12
switch(config-if)# switchport mode private-vlan host
switch(config-if)# switchport private-vlan host-association 5 101

对于primary vlan里的 promiscuous 端口,

switch(config)# interfaceethernet 1/2
switch(config-if)# switchport mode private-vlan promiscuous
switch(config-if)# switchport private-vlan mapping 5 109

promiscuous 端口也可能接一个监控主机之类的。

 

注意VMware vSphere也支持private VLAN, 在你编辑dvSwitch的时候可以看到一个provate VLAN的Tab, 然后可以定义VLAN ID, 然后还要创建port group等关联到private VLAN上, 但具体没有试过。