To define the private VLAN association for a promiscuous port, use
the
switchport
private-vlan
mapping command. To clear all mapping from the
primary VLAN, use the
no form of this command.
switchport private-vlan mapping { primary-vlan-id | trunk primary-vlan-id } { secondary-vlan-id | { add | remove } secondary-vlan-id }
no switchport private-vlan mapping [ { primary-vlan-id | trunk primary-vlan-id } secondary-vlan-id ]
Syntax Description
primary-vlan-id
|
Number of the primary VLAN of the private VLAN
relationship.
|
trunk
|
Specifies the private VLAN promiscuous trunk port.
Note
|
This keyword applies to only Layer 2 interfaces.
|
|
add
|
(Optional) Associates the secondary VLANs to the primary
VLAN.
|
secondary-vlan-id
|
Number of the secondary VLAN of the private VLAN
relationship.
|
remove
|
Clears the association between the secondary VLANs and the
primary VLAN.
|
Command Modes
Interface configuration mode
Virtual Ethernet interface configuration mode
Command History
Release
|
Modification
|
6.0(2)N1(1)
|
This command was introduced.
|
Usage Guidelines
There is no run-time effect on the port unless it is in private
VLAN-promiscuous mode. If the port is in private VLAN-promiscuous mode but the
primary VLAN does not exist, the command is allowed but the port is made
inactive.
The secondary VLAN may be an isolated or community VLAN.
See the
private-vlan command for more information on
pr imary VLANs, secondary VLANS,
and isolated or community ports.
Examples
This example shows how to configure the associated primary VLAN 18 to
secondary isolated VLAN 20 on a private VLAN promiscuous port:
switch# configure terminal
switch(config)# interface ethernet 1/1
switch(config-if)# switchport mode private-vlan promiscous
switch(config-if)# switchport private-vlan mapping 18 20
This example shows how to add a VLAN to the association on the
promiscuous port:
switch# configure terminal
switch(config)# interface ethernet 1/2
switch(config-if)# switchport mode private-vlan promiscous
switch(config-if)# switchport private-vlan mapping 18 add 21
This example shows how to configure the associated primary VLAN 30 to
secondary isolated VLANs 20-32 on a private VLAN promiscuous trunk port:
switch# configure terminal
switch(config)# interface ethernet 1/21
switch(config-if)# switchport mode private-vlan promiscous trunk
switch(config-if)# switchport private-vlan mapping trunk 30 20-32
switch(config-if)#
This example shows the error message that appears when you configure
the associated primary VLAN 30 to secondary isolated VLANs 50-100 (beyond the
total permissible limit of 16 secondary VLANs) on a private VLAN promiscuous
trunk port:
switch# configure terminal
switch(config)# interface ethernet 1/12
switch(config-if)# switchport mode private-vlan promiscous trunk
switch(config-if)# switchport private-vlan mapping trunk 30 50-100
ERROR: secondary VLAN list contains primary VLAN id in trunk promiscuous port mapping.
switch(config-if)#
This example shows how to remove all private VLAN associations from
the port:
switch# configure terminal
switch(config)# interface ethernet 1/5
switch(config-if)# no switchport private-vlan mapping
switch(config-if)#
This example shows how to configure the primary VLAN 12 to secondary
isolated VLAN 20 on a virtual Ethernet interface host:
switch# configure terminal
switch(config)# interface vethernet 1
switch(config-if)# switchport private-vlan mapping 12 20
switch(config-if)#