PVLAN
注意事项:
 PVLAN 只能在VTP transparent模式配置
 PVLAN 在一个primary vlan下可以有多个secondary vlan
 secondary vlan 下:可以有island port 、community port 、 promiscuous port。
 island port 仅可以和promiscuous port 相互通信。community port 可以和community port 、promiscuous port 相互通信。
 Unicast Reverse Path Forwarding (uRPF) does not work well with PVLAN host ports, so uRPF must not be
used in combination with PVLAN.(uRPF 端口不可以用在PVLAN host port上,不能与PVLAN结合使用)。
可通信的端口 主VLAN端口 公共VLAN端口 孤立VLAN端口
与主VLAN通信    是             是           是
与同一从VLAN通信   N/A             是           否
与其他从VLAN通信   N/A             否            否

配制命令:
 第一步:定义主vlan
      switch(config)# vlan (vlan-id)
      switch(config-vlan)# private-vlan primary
      switch(config-vlan)# exit
 第二步:设置辅助vlan,将主/辅助vlan 帮定在一起
      switch(config)# vlan (primary-vlan-id)
      switch(config-vlan)# private-vlan association {add|remove}(aue-vlan)
 第三步:
      switch(config)# interface vlan (primary-vlan-id)
      switch(config-if)# privst-vlan mapping (辅助vlan-id)
 第四步:
      Switch config-vlan # private-vlan [primary | isolated | community]   定义vlan类型
      Config-if# switchport mode private-vlan {host | promiscuous}
      配置从vlan的接口模式
      host表示团体模式或隔离模式
      promiscuous是混杂模式 
      Config-if# switchport private-vlan host-association primary_vlan_id secondary_vlan_id
      把团体端口和隔离端口划分到私有vlan中
  例如:
Vlan 202
Private-vlan primary
Private-vlan association 440
Vtp mode transpoarent       必须设置成透明模式
Vlan 440
Private-vlan isolated
int fast 5/2
switchport mode private-vlan promiscuous 设置混杂模式
switchport private-vlan mapping 202 440  把这个端口放到主vlan中,可以和从vlan 440的端口通信
int fast 5/1
switchport mode private-vlan host   定义为host端口,此端口可是隔离或团体模式,具体视它加入的vlan模式而定
switchport private-vlan host –association 202 440   定义它属于的主vlan 202中的隔离vlan440
int vlan 202
private-vlan mapping add 440   定义三层的虚拟端口vlan202 为私有vlan 440对外的通信端口
 第五步:校验命令
      show interfaces private_vlan mapping    查看私有vlan的配置信息
      show vlan private-vlan type             显示私有vlan的配置信息
     
小问题:
1.同一台交换机上最多可以同时建立多少个primary vlan ?
2.同一个vlan可否属于不同的primary vlan下的secandery vlan(也就是说一个vlan 可否同时是 island vlan 和 community vlan)?