Information About Private VLANs
Starting in Cisco Nexus NX-OS 7.0(3)I1(2), the private VLAN feature is supported.
Note |
You must enable the private VLAN feature before you can configure this feature. |
Note |
A Layer 2 port can function as either a trunk port, an access port, or a private VLAN port. |
In certain instances where similar systems do not need to interact directly, private VLANs provide additional protection at the Layer 2 level. Private VLANs are an association of primary and secondary VLANs.
A primary VLAN defines the broadcast domain with which the secondary VLANs are associated. The secondary VLANs may either be isolated VLANs or community VLANs. Hosts on isolated VLANs communicate only with associated promiscuous ports in primary VLANs, and hosts on community VLANs communicate only among themselves and with associated promiscuous ports but not with isolated ports or ports in other community VLANs.
In configurations that use integrated switching and routing functions, you can assign a single Layer 3 VLAN network interface to each private VLAN to provide routing. The VLAN network interface is created for the primary VLAN. In such configurations, all secondary VLANs communicate at Layer 3 only through a mapping with the VLAN network interface on the primary VLAN. Any VLAN network interfaces previously created on the secondary VLANs are put out-of-service.
Private VLAN Overview
You must enable private VLANs before the device can apply the private VLAN functionality.
You cannot disable private VLANs if the device has any operational ports in a private VLAN mode.
Note |
You must have already created the VLAN before you can convert the specified VLAN to a private VLAN, either primary or secondary. |
Primary and Secondary VLANs in Private VLANs
The private VLAN feature addresses two problems that users encounter when using VLANs:
-
Each VDC supports up to 4096 VLANs. If a user assigns one VLAN per customer, the number of customers that the service provider can support is limited.
-
To enable IP routing, each VLAN is assigned with a subnet address space or a block of addresses, which can result in wasting the unused IP addresses and creating IP address management problems.
Using private VLANs solves the scalability problem and provides IP address management benefits and Layer 2 security for customers.
The private VLAN feature allows you to partition the Layer 2 broadcast domain of a VLAN into subdomains. A subdomain is represented by a pair of private VLANs: a primary VLAN and a secondary VLAN. A private VLAN domain can have multiple private VLAN pairs, one pair for each subdomain. All VLAN pairs in a private VLAN domain share the same primary VLAN. The secondary VLAN ID differentiates one subdomain from another.
Note |
A private VLAN domain has only one primary VLAN. |
Secondary VLANs provide Layer 2 isolation between ports within the same private VLAN. The following two types are secondary VLANs within a primary VLAN:
-
Isolated VLANs—Ports within an isolated VLAN cannot communicate with each other at the Layer 2 level.
-
Community VLANs—Ports within a community VLAN can communicate with each other but cannot communicate with ports in other community VLANs or in any isolated VLANs at the Layer 2 level.
Private VLAN Ports
Note |
Both community and isolated private VLAN ports are labeled as PVLAN host ports. A PVLAN host port is either a community PVLAN port or an isolated PVLAN port depending on the type of secondary VLAN with which it is associated. |
The types of private VLAN ports are as follows:
-
Promiscuous port—A promiscuous port belongs to the primary VLAN. The promiscuous port can communicate with all interfaces, including the community and isolated host ports, that belong to those secondary VLANs associated to the promiscuous port and associated with the primary VLAN. You can have several promiscuous ports in a primary VLAN. Each promiscuous port can have several secondary VLANs, or no secondary VLANs, associated to that port. You can associate a secondary VLAN to more than one promiscuous port, as long as the promiscuous port and secondary VLANs are within the same primary VLAN. You may want to do this association for load balancing or redundancy purposes. You can also have secondary VLANs that are not associated to any promiscuous port, but these secondary VLANs cannot communicate to the Layer 3 interface.
Note
As a best practice, you should map all the secondary ports on the primary to minimize any loss of traffic.
-
Promiscuous trunk—You can configure a promiscuous trunk port to carry traffic for multiple primary VLANs. You map the private VLAN primary VLAN and either all or selected associated VLANs to the promiscuous trunk port. Each primary VLAN and one associated and secondary VLAN is a private VLAN pair, and you can configure a maximum of 16 private VLAN pairs on each promiscuous trunk port.
Note
Private VLAN promiscuous trunk ports carry traffic for normal VLANs as well as for primary private VLANs.
-
Isolated port—An isolated port is a host port that belongs to an isolated secondary VLAN. This port has complete Layer 2 isolation from other ports within the same private VLAN domain, except that it can communicate with associated promiscuous ports. Private VLANs block all traffic to isolated ports except traffic from promiscuous ports. Traffic received from an isolated port is forwarded only to promiscuous ports. You can have more than one isolated port in a specified isolated VLAN, and each port is completely isolated from all other ports in the isolated VLAN.
-
Isolated or secondary trunk—You can configure an isolated trunk port to carry traffic for multiple isolated VLANs. Each secondary VLAN on an isolated trunk port must be associated with a different primary VLAN. You cannot put two secondary VLANs that are associated with the same primary VLAN on an isolated trunk port. Each primary VLAN and one associated secondary VLAN is a private VLAN pair, and you can configure a maximum of 16 private VLAN pairs on each isolated trunk port.
Note
Private VLAN isolated trunk ports carry traffic for normal VLANs as well as for secondary private VLANs.
-
Community port—A community port is a host port that belongs to a community secondary VLAN. Community ports communicate with other ports in the same community VLAN and with associated promiscuous ports. These interfaces are isolated at Layer 2 from all other interfaces in other communities and from all isolated ports within the private VLAN domain.
Note |
Because trunks can support the VLANs that carry traffic between promiscuous, isolated, and community ports, the isolated and community port traffic might enter or leave the device through a trunk interface. |
Primary, Isolated, and Community Private VLANs
Because the primary VLAN has the Layer 3 gateway, you associate secondary VLANs with the primary VLAN in order to communicate outside the private VLAN. Primary VLANs and the two types of secondary VLANs, isolated VLANs and community VLANs, have these characteristics:
-
Primary VLAN— The primary VLAN carries traffic from the promiscuous ports to the (isolated and community) host ports and to other promiscuous ports.
-
Isolated VLAN —An isolated VLAN is a secondary VLAN that carries unidirectional traffic upstream from the hosts toward the promiscuous ports and the Layer 3 gateway. You can configure one isolated VLAN in a primary VLAN. In addition, each isolated VLAN can have several isolated ports, and the traffic from each isolated port also remains completely separate.
-
Community VLAN—A community VLAN is a secondary VLAN that carries upstream traffic from the community ports to the promiscuous port gateways and to other host ports in the same community. You can configure multiple community VLANs in a private VLAN domain. The ports within one community can communicate, but these ports cannot communicate with ports in any other community or isolated VLAN in the private VLAN.
Note |
The private VLAN traffic flows are unidirectional from the host ports to the promiscuous ports. Traffic that egresses the promiscuous port acts like the traffic in a normal VLAN, and there is no traffic separation among the associated secondary VLAN. |
A promiscuous port can serve only one primary VLAN, but it can serve multiple isolated VLANs and multiple community VLANs. (Layer 3 gateways are connected to the device through a promiscuous port.) With a promiscuous port, you can connect a wide range of devices as access points to a private VLAN. For example, you can use a promiscuous port to monitor or back up all the private VLAN servers from an administration workstation.
Note |
You can configure private VLAN promiscuous and isolated trunk ports. These promiscuous and isolated trunk ports carry traffic for multiple primary and secondary VLANs as well as normal VLAN. |
Although you can have several promiscuous ports in a primary VLAN, you can have only one Layer 3 gateway per primary VLAN.
In a switched environment, you can assign an individual private VLAN and associated IP subnet to each individual or common group of end stations. The end stations need to communicate only with a default gateway to communicate outside the private VLAN.
Note |
You must enable the VLAN interface feature before you can configure the Layer 3 gateway. See the Cisco Nexus 9000 Series NX-OS Interfaces Configuration Guide for complete information on VLAN network interfaces and IP addressing. |
Associating Primary and Secondary VLANs
To allow the host ports in secondary VLANs to communicate outside the private VLAN, you associate secondary VLANs to the primary VLAN. If the association is not operational, the host ports (isolated and community ports) in the secondary VLAN are brought down.
Note |
You can associate a secondary VLAN with only one primary VLAN. |
For an association to be operational, the following conditions must be met:
-
The primary VLAN must exist.
-
The secondary VLAN must exist.
-
The primary VLAN must be configured as a primary VLAN.
-
The secondary VLAN must be configured as either an isolated or community VLAN.
Note |
See the show command display to verify that the association is operational. The device does not issue an error message when the association is nonoperational. |
If you delete either the primary or secondary VLAN, the ports that are associated with the VLAN become inactive. When you reconvert the specified VLAN to private VLAN mode, the original associations are reinstated.
If the association is not operational on private VLAN trunk ports, only that VLAN goes down, not the entire port.
When you enter the no private-vlan command, the VLAN returns to the normal VLAN mode. All associations on that VLAN are suspended, but the interfaces remain in private VLAN mode.
If you enter the no vlan command for the primary VLAN, all private VLAN associations with that VLAN are lost. However, if you enter the no vlan command for a secondary VLAN, the private VLAN associations with that VLAN are suspended and return when you recreate the specified VLAN and configure it as the secondary VLAN.
Note |
This behavior is different from how Catalyst devices work. |
Note |
If you change the type of a primary VLAN to a normal/user VLAN (by issuing the no private-vlan primary command), all of the associations under that primary VLAN become nonoperational. However, if you change the type of the same VLAN back to a primary VLAN from a normal/user VLAN, the associations under the primary VLAN continue to be nonoperational, unless they are reconfigured under the primary VLAN after the type change. |
In order to change the association between a secondary and primary VLAN, you must first remove the current association and then add the desired association.
Broadcast Traffic in Private VLANs
Broadcast traffic from ports in a private VLAN flows in the following ways:
-
The broadcast traffic flows from all promiscuous ports to all ports in the primary VLAN. This broadcast traffic is distributed to all ports within the primary VLAN, including those ports that are not configured with private VLAN parameters.
-
The broadcast traffic from all isolated ports is distributed only to those promiscuous ports in the primary VLAN that are associated to that isolated port.
-
The broadcast traffic from community ports is distributed to all ports within the port’s community and to all promiscuous ports that are associated to the community port. The broadcast packets are not distributed to any other communities within the primary VLAN or to any isolated ports.
Private VLAN Port Isolation
You can use private VLANs to control access to end stations as follows:
-
Configure selected interfaces connected to end stations as isolated ports to prevent any communication at Layer 2. For example, if the end stations are servers, this configuration prevents Layer 2 communication between the servers.
-
Configure interfaces connected to default gateways and selected end stations (for example, backup servers) as promiscuous ports to allow all end stations access to a default gateway.
Private VLANs and VLAN Interfaces
A VLAN interface to a Layer 2 VLAN is also called a switched virtual interface (SVI). Layer 3 devices communicate with a private VLAN only through the primary VLAN and not through secondary VLANs.
Configure VLAN network interfaces only for primary VLANs. Do not configure VLAN interfaces for secondary VLANs. VLAN network interfaces for secondary VLANs are inactive while the VLAN is configured as a secondary VLAN. You will see the following actions if you misconfigure the VLAN interfaces:
-
If you try to configure a VLAN with an active VLAN network interface as a secondary VLAN, the configuration is not allowed until you disable the VLAN interface.
-
If you try to create and enable a VLAN network interface on a VLAN that is configured as a secondary VLAN, that VLAN interface remains disabled and the system returns an error.
When the primary VLAN is associated with and mapped to the secondary VLAN, any configuration on the primary VLAN is propagated to the secondary VLANs. For example, if you assign an IP subnet to the VLAN network interface on the primary VLAN, this subnet is the IP subnet address of the entire private VLAN.
Note |
You must enable the VLAN interface feature before you configure VLAN interfaces. See the Cisco Nexus 9000 Series NX-OS Interfaces Configuration Guide, for information on VLAN interfaces and IP addressing. |
Private VLANs Across Multiple Devices
You can extend private VLANs across multiple devices by trunking the primary, isolated, and community VLANs to other devices that support private VLANs. To maintain the security of your private VLAN configuration and to avoid other uses of the VLANs configured to be private VLANs, configure private VLANs on all intermediate devices, including devices that have no private VLAN ports.
Private VLAN with Inner VLAN Tag Preservation
Beginning with Cisco NX-OS Release 10.2(3)F, if you have configured the global system dot1q-tunnel transit <vlan> command on a supported Cisco Nexus switch that acts as a transit box, then the packets coming in on private vlan trunk ports with 2 or more tags are preserved and sent out without stripping any of the inner tags. For more information about the command, refer to Cisco Nexus 9000 Series NX-OS Interfaces Configuration Guide of the relevant release on cisco.com.
Note |
Inner tag preservation does not work when PVLAN and QinQ are configured on the same port. |
The following figure illustrates the inner tag preservation on the supported Cisco Nexus switch when the packet moves from PVLAN secondary trunk to PVLAN promiscuous trunk and back.
A sample configuration is as follows:
vlan 10
private-vlan primary
private-vlan association 11-12
vlan 11
private-vlan isolated
vlan 12
private-vlan community
interface Ethernet1/1
switchport
switchport mode private-vlan trunk secondary
switchport private-vlan association trunk 10 11
no shutdown
interface Ethernet1/2
switchport
switchport mode private-vlan trunk promiscuous
switchport private-vlan mapping trunk 10 11-12
no shutdown
(config)# system dot1q-tunnel transit vlan 10,11
Private VLANs on FEX Host Interface Ports
Beginning with 7.0(3)I2(1), Cisco Nexus NX-OS supports private VLANs (PVLANs) on Cisco Nexus 2000 Fabric Extender host facing ports (FEX HIF ports).
PVLANs are supported in singly connected host and singly connected FEX HIF configurations.
Note |
FEX HIF PC/VPC (port channel/virtual port channel) and FEX AA (active/active) configurations are not supported. |
High Availability for Private VLANs
The software supports high availability for both stateful and stateless restarts, as during a cold reboot, for private VLANs. For the stateful restarts, the software supports a maximum of three retries. If you try more than 3 times within 10 seconds of a restart, the software reloads the supervisor module.
Note |
When private VLANs are configured (for 7.0(3)I1(2) and earlier), downgrading to an earlier version of Cisco NX-OS is not supported. |
Note |
See the Cisco Nexus 9000 Series NX-OS High Availability and Redundancy Guide, for complete information on high-availability features. |