Private VLAN Commands
Use these commands to configure private VLANs.
This section describes the commands you use for private VLANs. Private VLANs provide Layer 2 isolation between ports that share the same broadcast domain. In other words, it allows a VLAN broadcast domain to be partitioned into smaller point-to-multipoint subdomains. The ports participating in a private VLAN can be located anywhere in the Layer 2 network.
switchport private-vlan
M4250
M4350
This command defines a private-VLAN association for an isolated or community port or a mapping for a promiscuous port.
| Format | switchport private-vlan {host-association primary-vlan-id secondary-vlan-id | mapping primary-vlan-id [add | remove] secondary-vlan-list | mapping trunk primary-vlan-id [add | remove] secondary-vlan-list} | trunk {native vlan vlan-id | allowed vlan vlan-list}} | association trunk primary-vlan-id secondary-vlan-id} |
| Mode | Interface Config |
| Parameter | Description |
|---|---|
| host-association | Defines the VLAN association for community or host ports. |
| mapping | Defines the private VLAN mapping for promiscuous ports. |
| mapping trunk | Maps the port to a primary VLAN and selected secondary VLANs. |
| primary-vlan-id | Primary VLAN ID of a private VLAN. |
| secondary-vlan-id | Secondary (isolated or community) VLAN ID of a private VLAN. |
| add | Associates the secondary VLAN with the primary one. |
| remove | Deletes the secondary VLANs from the primary VLAN association. |
| secondary-vlan-list | A list of secondary VLANs to be mapped to a primary VLAN. |
| trunk native vlan | Defines the VLAN association for untagged packets. If not configured, untagged packets are dropped. |
| trunk allowed vlan | Specifies the list of allowed normal VLANs on the trunk port. |
| association trunk | Associates a primary VLAN with a secondary VLAN (an isolated VLAN only). Multiple private VLAN pairs can be configured. |
no switchport private-vlan
This command removes the private-VLAN association or mapping from the port.
| Format | no switchport private-vlan {host-association | mapping | mapping trunk primary-vlan-id | trunk allowed vlan-list | trunk native vlan vlan-id | association trunk primary-vlan-id secondary-vlan-id} |
| Mode | Interface Config |
switchport mode private-vlan
M4250
M4350
This command configures a port as a promiscuous or host private VLAN port. Note that the properties of each mode can be configured even when the switch is not in that mode. However, they will only be applicable once the switch is in that particular mode.
| Format | switchport mode private-vlan {host | promiscuous | trunk promiscuous | trunk secondary} |
| Mode | Interface Config |
| Parameter | Description |
|---|---|
| host | Configures an interface as a private VLAN host port. It can be either isolated or community port depending on the secondary VLAN it is associated with. |
| promiscuous | Configures an interface as a private VLAN promiscuous port. The promiscuous ports are members of the primary VLAN. |
| trunk promiscuous |
Configures an interface as a private VLAN promiscuous trunk port. These ports can carry traffic of several primary VLANs and normal VLANs. An endpoint connected to a promiscuous trunk port is allowed to communicate with all the endpoints within the private VLAN and also with other ports participating in normal VLANs. These ports carry the traffic of multiple primary VLANs towards the upstream router and regular VLANs. Promiscuous trunk ports are used when the number of links connected to upstream devices must be reduced while all the endpoints in a private VLAN still must be managed, in addition to carrying traffic of normal VLANs. These ports are typically used where the switches are connected to upstream devices that do not detect private VLANs. |
| trunk secondary | Configures an interface as a private VLAN isolated trunk port. These ports can carry traffic of several secondary VLANs and normal VLANs. |
no switchport mode private-vlan
This command removes the private-VLAN association or mapping from the port.
| Format | no switchport mode private-vlan |
| Mode | Interface Config |
private-vlan
M4250
M4350
This command configures the private VLANs and configures the association between the primary private VLAN and secondary VLANs.
| Format | private-vlan {association [add | remove] secondary-vlan-list | community | isolated | primary} |
| Mode | VLAN Config, accessible from Global Config mode through entering vlan vlan-id |
| Parameter | Description |
|---|---|
| association | Associates the primary and secondary VLAN. |
| secondary-vlan-list | A list of secondary VLANs to be mapped to a primary VLAN. |
| community | Designates a VLAN as a community VLAN. |
| isolated | Designates a VLAN as the isolated VLAN. |
| primary | Designates a VLAN as the primary VLAN. |
no private-vlan
This command restores normal VLAN configuration.
| Format | no private-vlan [association] |
| Mode | VLAN Config, accessible from Global Config mode through entering vlan vlan-id |