Jan
31

You may want to see the updated version of this post at:

http://blog.internetworkexpert.com/2008/07/14/private-vlans-revisited/

Private VLAN concepts are quite simple, but Cisco’s implemenation and configuration steps are a bit confusing – with all the “mappings” and “associations” stuff. Here comes a short overview of how private VLANs work.

To begin with, let’s look at the concept of VLAN as a broadcast domain. What Private VLANs (PVANs) do, is split the domain into multiple isolated broadcast subdomains. It’s a simple nesting concept – VLANs inside a VLAN. As we know, Ethernet VLANs are not allowed to communicate directly, they need L3 device to forward packets between broadcast domains. The same concept applies to PVLANS – since the subdomains are isolated at level 2, they need to communicate using an upper level (L3 and packet forwarding) entity – such as router. However, there is difference here. Regular VLANs usually correspond to a single IP subnet. When we split VLAN using PVLANs, hosts in different PVLANs still belong to the same IP subnet, but they need to use router (another L3 device) to talk to each other (for example, by means of local Proxy ARP). In turn, router may either permit or forbid communications between sub-VLANs using access-lists.
Why would anyone need Private VLANs? Commonly, this kind of configurations arise in “shared” environments, say ISP co-location, where it’s beneficial to put multiple customers into the same IP subnet, yet provide a good level of isolation between them.

For our sample configuration, we will take VLAN 100 and divide it into two PVLANs – sub-VLANs 101 and 102. Take the regular VLAN and call it primary (VLAN 100 in our example), then divide ports, assigned to this VLAN, by their types:

Promiscuous (P): Usually connects to a router – a type of a port which is allowed to send and receive frames from any other port on the VLAN
Isolated (I): This type of port is only allowed to communicate with P-ports – they are “stub”. This type of ports usually connects to hosts
Community (C): Community ports are allowed to talk to their buddies, sharing the same group (of course they can talk to P-ports)

In order to implement sub-VLAN behavior, we need to define how packets are forwarded between different port types. First comes the Primary VLAN – simply the original VLAN (VLAN 100 in our example). This type of VLAN is used to forward frames downstream from P-ports to all other port types (I and C ports). In essense, Primary VLAN entails all port in domain, but is only used to transport frames from router to hosts (P to I and C). Next comes Secondary VLANs, which correspond to Isolated and Community port groups. They are used to transport frames in the opposite direction – from I and C ports to P-port.

Isolated VLAN: forwards frames from I ports to P ports. Since Isolated ports do not exchange frames with each other, we can use just ONE isolated VLAN to connect all I-Port to the P-port.
Community VLANs: Transport frames between community ports (C-ports) within to the same group (community) and forward frames uptstream to the P-ports of the primary VLAN.

This is how it works:

Primary VLANs is used to deliver frames downstream from router to all hosts; Isolated VLAN transports frames from stub hosts upstream to the router; Community VLANs allow frames exchange withing a single group and also forward frames in upstream direction towards P-port. All the basic MAC address learning and unknown unicast flooding princinples remain the same.

Let’s move to the configuration part (Primary VLAN 100, Isolated VLAN 101 and Community VLAN 102).

Step 1:

Create Primary and Secondary VLANs and group them into PVLAN domain:

!
! Creating VLANs: Primary, subject to subdivision
!
vlan 100
 private-vlan primary

!
! Isolated VLAN: Connects all stub hosts to router
!
vlan 101
 private-vlan isolated

!
! Community VLAN: allows a subVLAN within a Primary VLAN
!
vlan 102
 private-vlan community

!
!  Associating
!
vlan 100
 private-vlan assoc 101,102

What this step is needed for, is to group PVLANs into a domain and establish a formal association (for syntax checking and VLAN type verifications).

Step 2:

Configure host ports and bind them to the respective isolated PVLANs. Note that a host port belongs to different VLANs at the same time: downstream primary and upstream secondary.

!
! Isolated port (uses isoalated VLAN to talk to P-port)
!
interface FastEthernet x/y
 switchport mode private-vlan host
 switchport private-vlan host-association 100 101

!
! Community ports: use community VLAN
!
interface range FastEthernet x/y - z
 switchport mode private-vlan host
 switchport private-vlan host-association 100 102

Step 3:

Create a promiscuous port, and configure downstream mapping. Here we add secondary VLANs for which traffic is received by this P-port. Primary VLAN is used to send traffic downstream to all C/I ports as per their associations.

!
! Router port
!
interface FastEthernet x/y
 switchport mode private-vlan promisc
 switchport private-vlan mapping 100 add 101,102

if you need to configure an SVI on the switch, you should add an interface correspoding to Primary VLAN only. Obviously that’s because of all secondary VLANs being simply “subordiantes” of primary. In our case the config would look like this:

interface Vlan 100
 ip address 172.16.0.1 255.255.255.0

Lastly, there is another feature, worths to be mentioned, called protected port or Private VLAN edge. The feature is pretty basic and avaiable even on low-end Cisco switches, allows to isolate ports in the same VLAN. Specifically, all ports in a VLAN, marked as protected are prohibited from sending frames to each other (but still allowed to send frames to other (non-protected) ports within the same VLAN). Usually, ports configurated as protected, are also configured not to receive unknown unicast (frame with destination MAC address not in switch’s MAC table) and multicast frames flooding for added security.

Example:

interface range FastEthernet 0/1 - 2
 switchport mode access
 switchport protected
 switchport block unicast
 switchport block multicast
About Petr Lapukhov, 4xCCIE/CCDE:

Petr Lapukhov's career in IT begain in 1988 with a focus on computer programming, and progressed into networking with his first exposure to Novell NetWare in 1991. Initially involved with Kazan State University's campus network support and UNIX system administration, he went through the path of becoming a networking consultant, taking part in many network deployment projects. Petr currently has over 12 years of experience working in the Cisco networking field, and is the only person in the world to have obtained four CCIEs in under two years, passing each on his first attempt. Petr is an exceptional case in that he has been working with all of the technologies covered in his four CCIE tracks (R&S, Security, SP, and Voice) on a daily basis for many years. When not actively teaching classes, developing self-paced products, studying for the CCDE Practical & the CCIE Storage Lab Exam, and completing his PhD in Applied Mathematics.

Find all posts by Petr Lapukhov, 4xCCIE/CCDE | Visit Website


You can leave a response, or trackback from your own site.

50 Responses to “Understanding Private VLANs”

 
  1. [...] VLAN, PVLAN The Internetwork Expert blog continues to post excellent information and tutorials.  The most recent post concerns private VLANs.  This was a topic that confused the hell out of me at first.  I read the configuration guide and [...]

  2. Ali Hasan says:

    The best explanation I have ever read about PVLANs..that’s why i stick to Internetworkexpert.

  3. michael says:

    This is a very good article. Thanks for clearing up the confusion. One thing the article forgot to mention and I have to state the obvious is that PVLANs require VTP mode to be Transparent.

  4. Siva says:

    This document is excellent……….

  5. Joep says:

    Excellent explanation! You should be credited by CiscoPress, InternetworkExpert and all the others who leave bits and bytes out in their PVLAN explanation causing (complete) confusion. I’ve added you to my IE favorites.

  6. Joep says:

    And now i realize this is the InternetworkExpert forum (thanks Google) so i should have left InternetworkExpert out of my comment above :-)

  7. prashant says:

    Very simple & straight to the point description.

  8. [...] intro to private VLANs (with a little introduction to protected ports, as well), check out “Understanding Private VLANs” on the InternetworkExpert blog. Posted by Nick Chandler Filed in [...]

  9. Rukshy says:

    Thanku so much for such a straight & clear explanation.

  10. Marcus says:

    Yes, this article is very god, but i don’t understand one thing: on our port, witch is connect to router we configure :

    interface FastEthernet x/y
    switchport mode private-vlan promisc
    switchport private-vlan mapping 100 add 101,102

    what i should configure on my router sub’s ? something like

    interface Fa 0/1.1
    encaps dot 1q 101
    ip add x.x.x.x

    interface fa 0/1.2
    encaps dot 1q 102
    ip add x.x.x.x

    • Mike says:

      Your router port would just be 1 ip address without dot1q trunking or subinterfaces. Remember the point of private vlans is to split up 1 subnet into different broadcast domains. The router will only “see” vlan 100. Vlans 101 and 102 are only relevant once you get to the switch.

  11. vishvanath says:

    good

  12. Muhammed says:

    thanks so much for clear explanation

  13. [...] Came Across a really nice post regarding Private VLANs (PVLAN) today, if you’re interested take a look at Understanding Private VLANs [...]

  14. Jim says:

    This is a good document, and gives a good quick start to those who cannot peice the intenet of the structure together from the cisco site. I have a concern with “All the basic MAC address learning and unknown unicast flooding principles are the same”. This needs to be clarified, even if in a secondard document. If the certification exams test the very edge of our knowledge it would be good to know specifically how the switch does not pass the traffic to Isolated VLANS (as an example) or restated why if these priciples are exactly the same the switch does not simply do the lookup and forward the frame. Good work!! Thx, Jim

  15. Nigero says:

    Thanks for the good information. Very clear.

  16. Sandipani says:

    It’s wonderful.A beautiful understanding about the subject.

  17. prasanna says:

    Still not clear why would someone want private vlan..if you want to stop some of the devices communicate with each..simply put them in different vlan

  18. Jerricho says:

    good and clear explanation..

  19. Sriram says:

    Hi,
    I have 4 private-Vlan host ports which are all in the same private VLAN.( Basically used for backup). I would like to create LACP channel with all these 4 ports. is this possible on Cisco Catalyst 6500 Switches?

    Thanks & Regards
    Sriram

  20. [...] en Wikipedia. Me rsultó interesante también otra breve explicación en Cisco Press y un artículo en Internetwork Expert’s. Categories: General Tags: cisco, switching, vlans Comentarios (0) Referencias (0) Dejar [...]

  21. Ariel says:

    thank you very much for this article.
    finally i understand how private vlan works!

  22. Mathew Kumaly says:

    This is a good article ………….
    When i wah thinking about world end i get some information about vlan. I was so exited to know that…………..

  23. Andy Len says:

    Great, clear explanation on PVLANs, enough information to send to client with limited networking understanding. Well done Petr!

  24. IT’s really help me to understand this concept instead of books.

  25. Sai Lwin Thu says:

    Thanks , it’s clear explanation

  26. Jason Wang says:

    Excellent article Petr. I will be attending your class in Chicago in a couple weeks.

  27. Sagar Karale says:

    Awesome Explanation!!!
    This is the 3rd time I am referring to this blog and every time I got the solution. Very nice

  28. Roger says:

    We don’t need the mapping inside the SVI?
    Something like:
    interface Vlan 100
    ip address 172.16.0.1 255.255.255.0
    private-vlan mapping 101,102

  29. sandeep says:

    than k u very much those who dont know anything they can know many things about pvlan.completly satisfied.

  30. [...] MCSA:S 2k3,MCSE:S 2k3,MCITP:SA/EA CCNA:Security, CCNP Today 01:25 PM #173 Understanding Private VLANs | CCIE Blog Great explanation and configuration example for private vlans. "Configure host ports and [...]

  31. Cisco switch says:

    true, with so much to learn and think of. Thanks !!!

  32. pritam says:

    supperrbb explanation ..simple and clear …thanks a lot.

  33. Steven C says:

    Excellent explanation, was struggling with this concept in my CCNP book!

  34. Michael Wang says:

    Excellent artical. Just one question:

    Will the new mac address be copied between primary VLAN and secondary VLAN?
    I guess yes. Because if not, when a host send a packet from community VLAN and MAC is learned only in this VLAN, the replied packet from Promiscious port will be flooding in primary VLAN all the time. Am I correct?

  35. Nitin says:

    can private VLANS be configured only on stack switcjes?

  36. Zeynep says:

    Hi Aaron,I ran into the same problem here with Avaya phoens on a Cisco network and Windows 2008 DHCP. Because we diddn know exactly on which switchport the DHCP server was running we just quick and dirty added the voice VLAN to all access-ports, assuming this would de the job. Apparently it didn’t and it took me an hour of headaches before I ran into your blog.Your solution worked like a charm! So much for Worthless Words . Thanks very much for blogging this.Rick

  37. Mark Williams says:

    Well put, great explanation!!

  38. tejas says:

    short , simple & sweet xplanaion abt PVLAN’s……\m/

  39. John Spence says:

    Truly excellent explanation. Better than my CCNP Secure book by a mile. Thanks for writing this piece.

  40. Kishore says:

    Nice explanation with clear commands

  41. Arun says:

    good one !

  42. Blurgy says:

    So I was reading my Cisco book for an explanation and it was kind of useless.

    You make it sound easy :)

  43. Akash says:

    This one page explains the concept so clearly! Amazing technical writters at INE!

  44. Behzad Azarmehr says:

    Awesome.

 

Leave a Reply

Categories

CCIE Bloggers