private-vlan community
Use private-vlan community to enable Layer 2 communication between ports in a secondary VLAN.
Syntax
private-vlan community
Default
Ports in the same secondary VLAN can communicate with each other at Layer 2.
Views
VLAN view
Predefined user roles
network-admin
Usage guidelines
The private-vlan community command and the undo private-vlan isolated command have the same function. When you use the save command to save the configuration, the private-vlan community command is not saved into the configuration file.
Examples
This example shows how to meet the following requirements:
VLAN 4 is a secondary VLAN, and it is associated with primary VLAN 2.
Ten-GigabitEthernet 1/0/1 is a promiscuous port of VLAN 2.
Ten-GigabitEthernet 1/0/2 and Ten-GigabitEthernet 1/0/3 are host ports of VLAN 4.
Ten-GigabitEthernet 1/0/2 and Ten-GigabitEthernet 1/0/3 can communicate at Layer 2 in secondary VLAN 4.
# Configure VLAN 2 as a primary VLAN and associate it with secondary VLAN 4.
<Sysname> system-view [Sysname] vlan 2 [Sysname-vlan2] private-vlan primary [Sysname-vlan2] private-vlan secondary 4 [Sysname-vlan2] quit
# Configure Ten-GigabitEthernet 1/0/1 as a promiscuous port of VLAN 2.
[Sysname] interface ten-gigabitethernet 1/0/1 [Sysname-Ten-GigabitEthernet1/0/1] port private-vlan 2 promiscuous [Sysname-Ten-GigabitEthernet1/0/1] quit
# Assign Ten-GigabitEthernet 1/0/2 to VLAN 4 and configure the port as a host port.
[Sysname] interface ten-gigabitethernet 1/0/2 [Sysname-Ten-GigabitEthernet1/0/2] port access vlan 4 [Sysname-Ten-GigabitEthernet1/0/2] port private-vlan host [Sysname-Ten-GigabitEthernet1/0/2] quit
# Assign Ten-GigabitEthernet 1/0/3 to VLAN 4 and configure the port as a host port.
[Sysname] interface ten-gigabitethernet 1/0/3 [Sysname-Ten-GigabitEthernet1/0/3] port access vlan 4 [Sysname-Ten-GigabitEthernet1/0/3] port private-vlan host [Sysname-Ten-GigabitEthernet1/0/3] quit
# Enable Layer 2 communication in secondary VLAN 4.
[Sysname] vlan 4 [Sysname-vlan4] private-vlan community
Related commands
private-vlan isolated