Types of VLANs:
Benefits of VLANs:
Configuration Example:
set vlans vlan10 vlan-id 10
set interfaces ge-0/0/1 unit 0 family ethernet-switching vlan members vlan10
Purpose:
Use Case:
Configuration Example:
set interfaces ge-0/0/1 unit 0 family ethernet-switching vlan members 100
set vlans outer-vlan vlan-id 200
set protocols dot1q-tunneling
Purpose:
Behavior:
Configuration:
set protocols rstp bpdu-block
Create a VLAN and assign ports to it.
Create VLAN:
set vlans vlan10 vlan-id 10
Assign Interface to VLAN:
set interfaces ge-0/0/1 unit 0 family ethernet-switching vlan members vlan10
Enable RSTP on an Interface:
set protocols rstp interface ge-0/0/1
Enable BPDU Guard:
set protocols rstp bpdu-block
Set Root Bridge Priority:
set protocols rstp priority 4096
How STP Handles This:
Root Bridge Election:
Non-Root Switch Behavior:
Visualization:
Switch1 (Root Bridge)
/ \
Switch2 Switch3
\ /
[Blocked Port]
How MSTP Works:
Example:
Symptom:
Solution:
Manually set the priority of the intended Root Bridge to a lower value:
set protocols rstp priority 4096
Symptom:
Solution:
Enable BPDU Guard to disable ports receiving rogue BPDUs:
set protocols rstp bpdu-block
Symptom:
Solution:
Check the STP state:
show spanning-tree interface ge-0/0/1
Verify the root bridge and network configuration.
View STP Status:
show spanning-tree
Display Interface Roles:
show spanning-tree interface
Verify Root Bridge:
show spanning-tree bridge
Check BPDU Details:
show spanning-tree bpdu
Scenario:
Solution:
Use RSTP for fast convergence in case of a link failure.
Enable Root Guard to protect the core switch as the Root Bridge:
set protocols rstp root-protection
Root Bridge Configuration:
Enable STP Optimizations:
VLAN Grouping:
Monitoring and Troubleshooting:
While VLAN 1 is often the default VLAN, it’s important to understand what happens on trunk links, where multiple VLANs are carried.
A trunk port carries traffic from multiple VLANs using 802.1Q tagging.
However, one VLAN can be configured as the “Native VLAN”, whose traffic is transmitted untagged across the trunk.
“The Native VLAN is the VLAN whose traffic is transmitted untagged on a trunk link. By default, VLAN 1 is the native VLAN unless reconfigured.”
This is frequently tested in both certification exams and real-world interviews. Be aware that native VLAN mismatch between switches is a common misconfiguration issue that can lead to dropped or misrouted traffic.
The Bridge ID is used to determine the Root Bridge in STP and consists of:
Bridge Priority (default: 32768)
MAC Address (of the switch)
The switch with the lowest Bridge ID becomes the Root Bridge.
If multiple switches share the same priority, the MAC address becomes the tie-breaker.
“If two switches have the same bridge priority, the one with the lowest MAC address is selected.”
This is a subtle detail that often appears in multiple-choice questions involving root bridge selection in simulated topologies.
RSTP (Rapid Spanning Tree Protocol) introduces simplified port states and faster convergence. It merges and replaces some of the older STP states.
| STP State | RSTP Equivalent |
|---|---|
| Blocking | Discarding |
| Listening | Discarding |
| Learning | Learning |
| Forwarding | Forwarding |
Discarding: No user data is forwarded; port is waiting.
Learning: MAC addresses are being learned, but no forwarding yet.
Forwarding: Fully active port.
This mapping helps in interpreting STP transitions on exam questions or CLI outputs.
MSTP (Multiple Spanning Tree Protocol) was developed to address the inefficiency of running a separate STP instance for every VLAN (as in VSTP).
“Juniper recommends using 2–3 MST instances to group VLANs rather than creating one per VLAN, which would mimic VSTP and defeat the purpose.”
This advice is rooted in scalability and resource efficiency. Too many instances increase CPU and memory usage on switches unnecessarily.
Example:
MSTI 0 → VLANs 1–49
MSTI 1 → VLANs 50–99
MSTI 2 → VLANs 100–200
show spanning-tree (Optional but Useful)Understanding CLI output is essential for interpreting real-time topology roles and verifying configurations.
root bridge : 32768.00:11:22:33:44:55 (this switch)
designated bridge : 32768.00:11:22:33:44:55
root port : none (this switch is the root)
Interface Role State Cost Prio.Nbr Type
ge-0/0/1.0 Designated Forwarding 200000 128.1 Edge
ge-0/0/2.0 Root Forwarding 200000 128.2 P2p
ge-0/0/3.0 Alternate Discarding 200000 128.3 P2p
Root port: Used to reach the Root Bridge.
Designated port: Forwarding port for the segment.
Alternate port: Backup for the Root; blocked unless needed.
Edge: Port connected to a host (PortFast behavior).
This output helps validate port roles, STP state, and path costs, which are common troubleshooting scenarios.
| Area | Key Addition |
|---|---|
| Native VLAN | Only one VLAN is untagged on trunk links; default is VLAN 1 |
| Root Bridge Election | MAC address is tie-breaker when priority is equal |
| STP vs. RSTP | RSTP merges Blocking & Listening into Discarding |
| MSTP Optimization | Group VLANs into 2–3 instances for performance |
| show spanning-tree | Helps analyze roles, costs, and port states |
How is the root bridge selected in a Spanning Tree network?
The switch with the lowest bridge ID becomes the root bridge.
The bridge ID consists of:
Bridge priority
MAC address
The lowest bridge ID wins the root election.
If priorities are equal, the switch with the lowest MAC address becomes root.
Network administrators often manually set the root bridge by lowering the bridge priority on a specific switch.
Demand Score: 82
Exam Relevance Score: 86
Why might a port become a blocking port in Spanning Tree?
To prevent Layer 2 loops in redundant network topologies.
Spanning Tree disables redundant links to maintain a loop-free topology.
Ports may become blocking if they are:
Not part of the lowest-cost path to the root bridge
Redundant paths between switches
This prevents broadcast storms and MAC table instability.
Demand Score: 80
Exam Relevance Score: 83
What advantage does Rapid Spanning Tree Protocol (RSTP) provide compared to STP?
It significantly reduces network convergence time.
RSTP improves upon traditional STP by introducing faster state transitions and additional port roles.
Key improvements:
Faster convergence
Fewer intermediate port states
Immediate transition for edge ports
These improvements allow networks to recover more quickly from topology changes.
Demand Score: 78
Exam Relevance Score: 82
What is the role of a designated port in Spanning Tree?
It forwards traffic toward downstream segments in the spanning tree topology.
Each network segment has one designated port responsible for forwarding frames.
The designated port is the port with the lowest path cost to the root bridge on that segment.
Other ports on the segment may become blocking ports to prevent loops.
Demand Score: 75
Exam Relevance Score: 81