Example: Configuring an Interface as a Host Port This example shows how to configure an interface as a private VLAN host port, associate it with a private VLAN pair, and verify the configuration: Device# configure terminal Device(config)# interface gigabitethernet1/0/22 Device(config-if)# switchport mode private-vlan host Device(config-if)# switchport private-vlan host-association 20 501 Device(config-if)# end Device# show interfaces gigabitethernet1/0/22 switchport Name: Gi1/0/22 Switchport: Enabled Administrative Mode: private-vlan host Operational Mode: private-vlan host Administrative Trunking Encapsulation: negotiate Operational Trunking Encapsulation: native Negotiation of Trunking:
Off Access Mode VLAN: 1 (default) Trunking Native Mode VLAN: 1 (default) Administrative Native VLAN tagging: enabled Voice VLAN: none Administrative private-vlan host-association: 20 501 Administrative private-vlan mapping: none Administrative private-vlan trunk native VLAN: none Administrative private-vlan trunk Native VLAN tagging: enabled Administrative private-vlan trunk encapsulation: dot1q Administrative private-vlan trunk normal VLANs: none Administrative private-vlan trunk private VLANs: none Operational private-vlan: 20 501 truncated> Example:
Configuring an Interface as a Private VLAN Promiscuous Port This example shows how to configure an interface as a private VLAN promiscuous port and map it to a private VLAN. The interface is a member of primary VLAN 20 and secondary VLANs 501 to 503 are mapped to it. Device# configure terminal Device(config)# interface gigabitethernet1/0/2 Device(config-if)# switchport mode private-vlan promiscuous Device(config-if)# switchport private-vlan mapping 20 add 501-503 Device(config-if)# end Use the show vlan private-vlan or the show interface status privileged EXEC command to display primary and secondary VLANs and private-VLAN ports on the device. Example:
Mapping Secondary VLANs to a Primary VLAN Interface This example shows how to map the interfaces fo VLANs 501 and 502 to primary VLAN 10, which permits routing of secondary VLAN ingress traffic from private VLANs 501 and 502: Device# configure terminal Device(config)# interface vlan 20 Configuring Private VLANs Example: Configuring an Interface as a Host Port VLAN Configuration Guide, Cisco IOS XE 17.16.x (Catalyst 9300 Switches) 92