Ethernet Switching and Spanning Tree · Topic 1 of 3
Advanced Switching, Filter-Based and Private VLANs
JN0-650 study page on advanced Ethernet switching, filter-based VLANs and private VLANs: port types, isolation rules, and how to verify them on EX and QFX.
- 5 min
- Includes a diagram
- Filter-based VLAN: a firewall filter (family
ethernet-switching) with a VLAN action, applied as input on the interface. - PVLAN: one primary VLAN, secondary VLANs of type community or isolated.
- Isolated: promiscuous ports only. Community: same community and promiscuous.
What it is
A normal VLAN is assigned by the port a frame arrives on. Advanced switching adds ways to place or restrict traffic more precisely.
A filter-based VLAN uses a firewall filter to assign matching frames to a VLAN, so the assignment depends on the frame contents (for example the source MAC address or protocol) and not only on the port.
A private VLAN (PVLAN) splits one VLAN and subnet into isolated parts, so hosts in the same subnet cannot talk to each other directly unless policy allows it.
How it works
Frame handling in brief
A switch learns the source MAC address of each frame, records the port and VLAN, and forwards frames by destination MAC address within the VLAN. Unknown unicast, broadcast and unregistered multicast frames are flooded to all other ports in the VLAN. You see the table with show ethernet-switching table.
On EX and QFX switches that use the Enhanced Layer 2 Software (ELS) CLI, a port is configured with family ethernet-switching, interface-mode (access or trunk) and vlan members. MX routers use family bridge instead, but the concepts are the same.
set interfaces ge-0/0/5 unit 0 family ethernet-switching interface-mode access vlan members v10
Filter-based VLANs
A filter-based VLAN uses a firewall filter of family ethernet-switching. The filter matches frame fields, and the action puts the frame into a VLAN. It is applied as an input filter on an interface.
set vlans v10 vlan-id 10
set vlans v20 vlan-id 20
set firewall family ethernet-switching filter FBV term phone from source-mac-address 00:11:22:00:00:00/24
set firewall family ethernet-switching filter FBV term phone then vlan v20
set firewall family ethernet-switching filter FBV term rest then accept
set interfaces ge-0/0/5 unit 0 family ethernet-switching filter input FBV
The VLANs named in the actions must exist. Use this when the VLAN must follow the type of traffic or device, and the port cannot decide.
If the requirement says "assign frames to a VLAN based on the source MAC address, protocol or other header fields", a firewall filter with a VLAN action is the answer, not a port VLAN.
Filter order matters. The first matching term decides the VLAN, so put the specific terms before the catch-all term.
Private VLANs
A PVLAN has one primary VLAN and one or more secondary VLANs. All members share one IP subnet, but the secondary VLANs control who can talk to whom.
| Secondary VLAN | Behavior |
|---|---|
| Community | Hosts talk to each other and to promiscuous ports, not to other communities |
| Isolated | Hosts talk only to promiscuous ports, not even to each other |
| Port type | Connects | Can reach |
|---|---|---|
| Promiscuous | Router, firewall or gateway | All ports in the primary VLAN |
| Community | Hosts in one community | Same community and promiscuous ports |
| Isolated | Single hosts | Promiscuous ports only |
| PVLAN trunk | Another switch, carrying the PVLAN | The ports behind the other switch |
Typical uses: servers in a hosting network that share a subnet but must not reach each other, and hotel or campus access networks.
When a PVLAN spans switches, an inter-switch link carries the primary and secondary VLANs through a PVLAN trunk, and promiscuous ports stay on the switch that connects to the gateway. A Layer 3 interface is placed on the primary VLAN, so hosts in every secondary VLAN use one default gateway. The exact statements differ between platforms and software versions, so build on the CLI help for your platform and check the result with:
show vlans extensive
show ethernet-switching table
show ethernet-switching interface
Configuration follows this outline: create the primary VLAN with its ID, create each secondary VLAN and tie it to the primary, put each host port in a secondary VLAN, and make the gateway port promiscuous by carrying the primary VLAN on it.
Think of the primary VLAN as downstream (promiscuous to host) and the secondary VLANs as upstream (host to promiscuous). Traffic between secondary VLANs is blocked at Layer 2, so it can only be forwarded by a router on a promiscuous port.
Troubleshooting
| Symptom | Likely cause |
|---|---|
| Isolated hosts cannot reach the gateway | Gateway not on a promiscuous port, or the primary VLAN missing on that port |
| Hosts in different communities talk | A host port is in the wrong secondary VLAN |
| PVLAN works on one switch, not across two | The inter-switch link is not a PVLAN trunk, or a VLAN is missing on one side |
| Filter-based VLAN has no effect | Filter not applied as input on the interface, or an earlier term matched first |
| Frame ends in the wrong VLAN | The term order, or the VLAN named in the action |
Common mistakes
Expecting isolated hosts to reach community hosts. Isolated hosts reach promiscuous ports only.
Putting the router on a community port. The router must be on a promiscuous port.
Giving each secondary VLAN its own subnet. All secondary VLANs share the primary VLAN subnet.
Applying a filter-based VLAN filter in the output direction. It is an input filter.
Using a PVLAN to stop routing between subnets. It isolates inside one subnet, not between subnets.
What to remember for the exam
- Filter-based VLAN: a firewall filter (family
ethernet-switching) with a VLAN action, applied as input on the interface. - PVLAN: one primary VLAN, secondary VLANs of type community or isolated.
- Isolated: promiscuous ports only. Community: same community and promiscuous.
- Promiscuous ports connect the gateway; a PVLAN trunk connects switches.
- All PVLAN members share one subnet and one default gateway.
- ELS uses
family ethernet-switching,interface-modeandvlan members.
Check yourself
Which PVLAN port type can reach every other port in the primary VLAN?
The promiscuous port, normally connected to the gateway.
Can two hosts in an isolated secondary VLAN exchange frames?
No, isolated hosts can talk only to promiscuous ports.
How do you place frames from specific source MAC addresses into a VLAN?
With an
ethernet-switchingfirewall filter that matches the MAC and has a VLAN action, applied as an input filter.
Topic 1 of 3 in Ethernet Switching and Spanning Tree
Test yourself on Ethernet Switching and Spanning Tree
The full Juniper JNCIP-ENT JN0-650 question bank has 858 questions, with timed practice exams and an explanation for every answer.
This study guide is independent and is not affiliated with, endorsed by, or sponsored by Juniper. Vendor names, certification names and exam codes are trademarks of their respective owners and are used for identification only.