USD ($)
$
United States Dollar
India Rupee

What are Private VLANs: Configuration on Cisco Switches

Created by Deepak Sharma in Articles 23 Sep 2024
Share
«Router on a Stick Configuration: ...

As a network engineer, you have a powerful and valuable tool at your disposal - Private VLANs (PVLANs) in Cisco switches. With PVLANs, you can enhance the security and efficiency of your network by dividing traditional VLANs into primary, secondary, and isolated ports.

When implementing PVLANs, you gain greater control over how devices communicate within VLANs. You can designate specific ports as primary, secondary, or isolated, allowing for a more granular and secure network environment.

In this article, we will learn about Private VLANs and understand how to configure Private VLAN in Cisco switches.

To further your expertise in configuring and managing PVLANs, obtaining Cisco certifications such as the Cisco Certified Network Associate (CCNA) or Cisco Certified Network Professional (CCNP) can be invaluable. These certifications provide in-depth knowledge of networking concepts, including VLAN configurations and security best practices.

What is Private VLAN?

Private VLAN (PVLAN) is a specialized type of Virtual Local Area Network (VLAN) that enhances network security and traffic management by allowing multiple isolated subdomains within a single VLAN. Unlike traditional VLANs, where all devices can communicate with each other, PVLANs restrict communication between devices connected to the same physical link.

One of the main and important benefits of PVLANs is that the devices within the same VLANs can be isolated preventing them not to communicate with each other. This isolation boosts network security, safeguarding sensitive or critical devices from potential threats.

Moreover, PVLANs empower you to specify which ports devices can use to communicate. By designating certain ports as the only means of communication between devices, you optimize network resources and reduce unnecessary traffic.

Especially in large-scale Ethernet environments with multiple interconnected switches, PVLANs become an essential tool for maintaining a secure and efficient network infrastructure.


CCNP Live TrainingJoin live class with virtual labExplore course
custom banner static image

To understand the concept of private VLANs better, let's take a scenario of three Cisco Switches connected via a link and here we'll understand how to implement private VLANs which allow isolations within the same VLANs and other communications between primary and secondary VLANs.

Scenario Overview:

Let's consider a scenario in which a company has three Cisco switches connected. The goal is to configure Private VLANs to enhance security and restrict communication between certain devices within the VLANs.

Topology Diagram:

banner image

VLAN Configuration:

First, we need to configure the VLANs on each Cisco switch. Assume we have the following VLANs:

● VLAN 10: Servers VLAN (Primary VLAN)

● VLAN 20: IoT Devices VLAN (Secondary VLAN)

● VLAN 30: Guest Devices VLAN (Secondary VLAN)

PVLAN Communication:

In this scenario, the Private VLANs are configured as follows:

Communication between isolated ports (e.g., GigabitEthernet1/0/4 on Switch A, GigabitEthernet1/0/4 on Switch B, and GigabitEthernet1/0/4 on Switch C) is blocked. This isolation enhances security and prevents direct communication between end-user devices.

Communication between isolated ports and the promiscuous port (GigabitEthernet1/0/3 on all switches) is allowed. This enables connectivity to the resources in the primary VLAN (VLAN 10), such as servers and gateways.

Communication between devices in the secondary VLANs (VLAN 20 and VLAN 30) is blocked. Secondary VLANs operate in isolation from each other.

Communication between devices within the same secondary VLAN (e.g., between two IoT devices in VLAN 20 on Switch A) is allowed, as long as they are connected to the promiscuous port (GigabitEthernet1/0/3).

How to Configure Private VLAN:

Next, we'll set up the Private VLANs on each switch to enhance security and restrict communication.

Switch A Configuration:

# Create primary VLAN 10

vlan 10

name Servers_VLAN

# Create secondary VLAN 20 and associate it with primary VLAN 10

vlan 20

name IoT_VLAN

private-vlan primary 10

# Create secondary VLAN 30 and associate it with primary VLAN 10

vlan 30

name Guest_VLAN

private-vlan primary 10

# Configure interfaces as trunk ports to connect to Switch B and Switch C

interface GigabitEthernet1/0/1

switchport mode trunk

interface GigabitEthernet1/0/2

switchport mode trunk

Switch B Configuration:

# Create primary VLAN 10

vlan 10

name Servers_VLAN

# Create secondary VLAN 20 and associate it with primary VLAN 10

vlan 20

name IoT_VLAN

private-vlan primary 10

# Create secondary VLAN 30 and associate it with primary VLAN 10

vlan 30

name Guest_VLAN

private-vlan primary 10

# Configure interfaces as trunk ports to connect to Switch A and Switch C

interface GigabitEthernet1/0/1

switchport mode trunk

interface GigabitEthernet1/0/2

switchport mode trunk

Switch C Configuration:

# Create primary VLAN 10

vlan 10

name Servers_VLAN

# Create secondary VLAN 20 and associate it with primary VLAN 10

vlan 20

name IoT_VLAN

private-vlan primary 10

# Create secondary VLAN 30 and associate it with primary VLAN 10

vlan 30

name Guest_VLAN

private-vlan primary 10

# Configure interfaces as trunk ports to connect to Switch A and Switch B

interface GigabitEthernet1/0/1

switchport mode trunk

interface GigabitEthernet1/0/2

switchport mode trunk

PVLAN Configuration on Switch A:

Now, we'll configure the Private VLANs on Switch A to enhance security.

# Configure interface GigabitEthernet1/0/3 as a promiscuous port for primary VLAN 10

interface GigabitEthernet1/0/3

switchport mode private-vlan promiscuous

switchport private-vlan mapping 10 20,30

# Configure interface GigabitEthernet1/0/4 as an isolated port for secondary VLAN 20

interface GigabitEthernet1/0/4

switchport mode private-vlan host

switchport private-vlan host-association 10 20

# Configure interface GigabitEthernet1/0/5 as an isolated port for secondary VLAN 30

interface GigabitEthernet1/0/5

switchport mode private-vlan host

switchport private-vlan host-association 10 30

PVLAN Configuration on Switch B:

# Configure interface GigabitEthernet1/0/3 as a promiscuous port for primary VLAN 10

interface GigabitEthernet1/0/3

switchport mode private-vlan promiscuous

switchport private-vlan mapping 10 20,30

# Configure interface GigabitEthernet1/0/4 as an isolated port for secondary VLAN 20

interface GigabitEthernet1/0/4

switchport mode private-vlan host

switchport private-vlan host-association 10 20

# Configure interface GigabitEthernet1/0/5 as an isolated port for secondary VLAN 30

interface GigabitEthernet1/0/5

switchport mode private-vlan host

switchport private-vlan host-association 10 30

PVLAN Configuration on Switch C:

# Configure interface GigabitEthernet1/0/3 as a promiscuous port for primary VLAN 10

interface GigabitEthernet1/0/3

switchport mode private-vlan promiscuous

switchport private-vlan mapping 10 20,30

# Configure interface GigabitEthernet1/0/4 as an isolated port for secondary VLAN 20

interface GigabitEthernet1/0/4

switchport mode private-vlan host

switchport private-vlan host-association 10 20

# Configure interface GigabitEthernet1/0/5 as an isolated port for secondary VLAN 30

interface GigabitEthernet1/0/5

switchport mode private-vlan host

switchport private-vlan host-association 10 30

Private VLAN and Configuration - Conclusion

Private VLANs (PVLANs) offer network engineers a powerful tool to enhance security and optimize network resources in large-scale Ethernet environments. By segmenting traditional VLANs into primary, secondary, and isolated ports, PVLANs provide granular control over communication within VLANs.

In the example scenario with three interconnected Cisco switches, we configured PVLANs to enhance security, restricting communication between certain devices and allowing communication only through designated ports. By implementing PVLANs, organizations can achieve improved network security and better utilize network resources in multi-switch environments.

Cisco Default Route Configuration ...»
Deepak Sharma

He is a senior solution network architect and currently working with one of the largest financial company. He has an impressive academic and training background. He has completed his B.Tech and MBA, which makes him both technically and managerial proficient. He has also completed more than 450 online and offline training courses, both in India and ...

More... | Author`s Bog | Book a Meeting

Related Articles

#Explore latest news and articles

CCNA Course Syllabus: Topics Explained 25 Nov 2024

CCNA Course Syllabus: Topics Explained

Examine the latest Cisco CCNA course syllabus and understand the details of each 200-301 exam topics with practical on lab devices. Start Now!
Cisco Port Channel Configuration: Steps 15 Nov 2024

Cisco Port Channel Configuration: Steps

Understand step by step Cisco port channel configuration. Etherchannel protocols bond Cisco IOS switches ports for interface redundancy. Read More!
Understanding Cisco Rapid PVST+ with Configuration and Topology 30 Aug 2024

Understanding Cisco Rapid PVST+ with Configuration and Topology

Understand what is spanning tree particularly rapid pvst+ with its configuration on Cisco switches topology scenario.

FAQ

Private VLANs (PVLANs) are used to enhance network security by isolating devices within the same VLAN, preventing direct communication between them while allowing access to a common uplink. This isolation is particularly beneficial in multi-tenant environments, such as data centers and service providers, where security and traffic management are crucial.
The primary difference between a Local Area Network (LAN) and a private VLAN lies in their communication capabilities. A LAN allows all devices to communicate freely within the same broadcast domain, facilitating straightforward interaction among devices. In contrast, a private VLAN restricts communication between devices on the same VLAN, enhancing security and control by creating isolated subdomains that prevent unauthorized access.
There are three types of VLANs: primary VLANs, isolated VLANs, and community VLANs. The primary VLAN serves as the main VLAN that contains all ports. Isolated VLANs allow communication only with a promiscuous port, while community VLANs enable communication between ports within the same community and with a promiscuous port, facilitating controlled interactions among specific groups of devices.
To create a private VLAN, you need to configure a primary VLAN along with its associated secondary VLANs, which include isolated and community types. This involves assigning appropriate VLAN IDs, designating specific ports as promiscuous or isolated, and ensuring proper interface configurations on your switch.

Comments (1)

sanchit thareja Student
12 Oct 2023 | 11:44 pm

hey Deepak, can you also please write an article on configuring private vlans on nexus switches. I appreciate your efforts, I read all your articles.

Share

Share this post with others

Contact learning advisor

Captcha image