PVLANs achieve device isolation through the use of three separate port designations, each having its own unique set of rules regulating each connected endpoint's ability to communicate with other connected endpoints within the same private VLAN domain.
Private VLAN Domains
A private VLAN domain consists of one or more pairs of VLANs. The primary VLAN makes up the domain; and each VLAN pair makes up a subdomain. The VLANs in a pair are called the primary VLAN and the secondary VLAN. All VLAN pairs within a private VLAN have the same primary VLAN. The secondary VLAN ID is what differentiates one subdomain from another. See the following figure.
Figure 1. Private VLAN Domain
Spanning Multiple Switches
Private VLANs can span multiple switches, just like regular VLANs. Inter-switch link ports need not be aware of the special VLAN type and carry frames tagged with these VLANs just like they do any other frames. Private VLANs ensure that traffic from an isolated port in one switch does not reach another isolated or community port in a different switch even after traversing an inter-switch link. By embedding the isolation information at the VLAN level and by transporting it along with the packet, it is possible to maintain consistent behavior throughout the network. Therefore, the mechanism which restricts Layer 2 communication between two isolated ports in the same switch, also restricts Layer 2 communication between two isolated ports in two different switches.
Private VLAN Ports
Within a private VLAN domain, there are three separate port designations. Each port designation has its own unique set of rules which regulate the ability of one endpoint to communicate with other connected endpoints within the same private VLAN domain. The following are the three port designations:
promiscuous
isolated
community
Primary VLANs and Promiscuous Ports
The primary VLAN encompasses the entire private VLAN domain. It is a part of each subdomain and provides the Layer 3 gateway out of the VLAN. A private VLAN domain has only one primary VLAN. Every port in a private VLAN domain is a member of the primary VLAN. In other words, the primary VLAN is the entire private VLAN domain.
As the name suggests, a promiscuous port can talk to all other types of ports. A promiscuous port can talk to isolated ports as well as community ports and vice versa. Layer 3 gateways, DHCP servers and other trusted devices that need to communicate with the customer endpoints are typically connected with a promiscuous port. A promiscuous port can be either an access port or a hybrid/trunk port according to the terminology presented in Annex D of the IEEE 802.1Q specification.
Secondary VLANs and Host Ports
Secondary VLANs provide Layer 2 isolation between ports in a private VLAN domain. A private VLAN domain can have one or more subdomains. A subdomain is made up of a VLAN pair consisting of the primary VLAN and a secondary VLAN. Since the primary VLAN is a part of every subdomain, secondary VLANs differentiate the VLAN subdomains.
In order to communicate to the Layer 3 interface, a secondary VLAN must be associated with at least one of the promiscuous ports in the primary VLAN. You can associate a secondary VLAN to more than one promiscuous port within the same private VLAN domain, for example, if needed for load-balancing or redundancy. A secondary VLAN that is not associated with any promiscuous port cannot communicate with the Layer 3 interface.
A secondary VLAN can be one of the following types:
Isolated VLANs— Isolated VLANs use isolated host ports. An isolated port (i1 or i2 in the above figure) cannot talk to any other port in that private VLAN domain except for promiscuous ports. If a device needs to have access only to a gateway router, then it should be attached to an isolated port. An isolated port is typically an access port, but in certain applications it can also be a hybrid or trunk port.
The distinct characteristic of an isolated VLAN is that it allows all its ports to have the same degree of segregation that could be obtained from using one separate dedicated VLAN per port. Only two VLAN identifiers are consumed in providing this port isolation.
Note
While there can be multiple community VLANs in a private VLAN domain, one isolated VLAN is sufficient to serve multiple customers. All endpoints connected to its ports are isolated at Layer 2. Service providers can assign multiple customers to the same isolated VLAN, and be assured that their Layer 2 traffic cannot be sniffed by other customers sharing the same isolated VLAN.
Community VLANs—Community VLANs use community host ports. A community port (c1 or c2 in the above figure) is part of a group of ports. The ports within a community can have Layer 2 communications with one another and can also talk to any promiscuous port. If an ISP customer has, for example, 4 devices and wants them isolated from those of other customers but still be able to communicate among themselves, then community ports should be used.
Note
Because trunks can support a VLAN carrying traffic between its ports, it is possible for VLAN traffic to enter or leave the device through a trunk interface.
Communication Between Private VLAN Ports
The following table shows how access is permitted or denied between private VLAN port types.
1 An interswitch link port is a regular port that connects two switches and that happens to carry two or more VLANs.
2 This behavior applies to traffic traversing inter-switch link ports over an isolated VLAN only. Traffic from an inter-switch link port to an isolated port will be denied if it is in the isolated VLAN. Traffic from an inter-switch link port to an isolated port will be permitted if it is in the primary VLAN.
Guidelines and Limitations
Private VLAN has the following configuration guidelines and limitations:
Control VLANs, packet VLANs, and management VLANs must be configured as regular VLANs and not as private VLANs.
Default Settings
Table 2 Default VLAN Settings
Parameters
Default
Private VLANs
Disabled
Configuring a Private VLAN
The following section guides you through the private VLAN configuration process. After completing each procedure, return to this section to make sure that you have completed all required procedures in the correct sequence.
The VLAN you are configuring as a primary VLAN already exists in the system as a normal VLAN, and you know the VLAN ID.
Note
If the VLAN does not already exist, you are prompted to create it when you create the primary VLAN. For information about creating a VLAN, see Creating a VLAN.
Procedure
Command or Action
Purpose
Step 1
switch# configure terminal
Enters global configuration mode.
Step 2
switch(config)# vlanprimary-vlan-id
Enters VLAN configuration mode for the specified VLAN and configures the primary VLAN ID in the running configuration.
Step 3
switch(config-vlan)# private-vlan primary
Designates the primary VLAN as a private VLAN in the running configuration.
The VLAN you are configuring as a secondary VLAN already exists in the system as a normal VLAN, and you know the VLAN ID.
Note
If the VLAN does not already exist, you are prompted to create it when you create the secondary VLAN. For information about creating a VLAN, see Creating a VLAN.
You know whether you want the secondary VLANs to be community VLANs or isolated VLANs, and the VLAN IDs for each.
Procedure
Command or Action
Purpose
Step 1
switch# configure terminal
Enters global configuration mode.
Step 2
switch(config)# vlansecondary-vlan-id
Enters VLAN configuration mode for the specified VLAN and configures the secondary VLAN ID in the running configuration.
Saves the running configuration persistently through reboots and restarts by copying it to the startup configuration.
switch# configure terminal
switch(config)# vlan 202
switch(config-vlan)# private-vlan community
switch(config-vlan)# show vlan private-vlan
Primary Secondary Type Ports
------- --------- --------------- -------------------------------------------
202 community
switch(config-vlan)#
Associating the VLANs in a PVLAN
Use this procedure to associate the primary VLANs in a PVLAN with the secondary VLANs.
Before You Begin
You are logged in to the CLI in EXEC mode.
The primary VLAN for this PVLAN is already configured as a PVLAN.
The secondary VLANs for this PVLAN are already configured as PVLANs.
You know the VLAN IDs for each VLAN that is a part of the PVLAN.
Procedure
Command or Action
Purpose
Step 1
switch# configure terminal
Enters global configuration mode.
Step 2
switch(config)# vlanprimary-vlan-id
Enters VLAN configuration mode and associates the VLANs to function as a PVLAN in the running configuration.
Step 3
switch(config-vlan)# private-vlan association { add | remove } secondary vlan-id
Associates a specified secondary VLAN with the primary VLAN to function as a PVLAN in the running configuration. To associate additional secondary VLANs repeat this step.
Configuring a Layer 2 Interface as a Promiscuous Trunk Port
Use this procedure to configure a Layer 2 interface as a promiscuous trunk port that does the following:
Combines multiple promiscuous ports into a single trunk port.
Carries all normal VLANs.
Carries multiple PVLAN primary VLANs each with selected secondary VLANs.
Note
A promiscuous port can be either access or trunk. If you have one primary vlan you can use a promiscuous access port. If you have multiple primary vlans you can use a promiscuous trunk port.
Before You Begin
You are logged in to the CLI in EXEC mode.
The private-vlan mapping trunk command does not decide or override the trunk configuration of a port.
The port is already configured in a regular trunk mode before adding the private-vlan trunk configurations.
Primary VLANs must be added to the list of allowed VLAN for the promiscuous trunk port.
Secondary VLANs are not configured in the allowed VLAN list.
The trunk port can carry normal VLANs in addition to primary VLANs.
You can map up to 64 primary VLANs to their secondary VLANs in one promiscuous trunk port.
Procedure
Command or Action
Purpose
Step 1
switch# configure terminal
Enters global configuration mode.
Step 2
switch(config)# interfacetype slot/port
Enters interface configuration mode for the specified interface.
Saves the change persistently through reboots and restarts by copying the running configuration to the startup configuration.
switch# configure terminal
switch(config)# interface eth3/2
switch(config-if)# switchport private-vlan mapping 202 303
switch(config-if)# show vlan private-vlan
Primary Secondary Type Ports
------- --------- --------------- -------------------------------------------
202 303 community Eth3/2, Veth1
switch(config-if)#
Removing a Private VLAN Configuration
Use this procedure to remove a private VLAN configuration and return the VLAN to normal VLAN mode.
Before You Begin
You are logged in to the CLI in EXEC mode.
The VLAN is configured as a private VLAN, and you know the VLAN ID.
When you remove a PVLAN configuration, the ports associated with it become inactive.
Procedure
Command or Action
Purpose
Step 1
switch# configure terminal
Enters global configuration mode.
Step 2
switch(config)# vlanprivate vlan-id
Enters the VLAN configuration mode for the specified VLAN.
Step 3
switch(config-vlan)# no private-vlan { community | isolated | primary }
Removes the specified VLAN from a PVLAN in the running configuration.
The private VLAN configuration is removed from the specified VLAN(s). The VLAN is returned to normal VLAN mode. The ports associated with the VLAN are inactive.
The following example configuration shows how to configure interface eth2/6 using port-profile, uppvlanpromtrunk156.
In this configuration, packets from secondary interfaces 153, 154, and 155 are translated into the primary VLAN 156 as a result of the command, switchport private-vlan mapping trunk 156 153-155.