PermitANY
JuniperConfig623 downloads

Juniper JunOS VLAN & Layer 2 Switching

VLAN configuration with IRB (Integrated Routing and Bridging) interfaces, access/trunk switchports, and RSTP for Juniper EX series switches.

↓ example.txt

What is it?

Juniper EX switches use a different VLAN model than Cisco. VLANs are defined globally under 'set vlans' and referenced by name on interfaces. Layer 3 routing for a VLAN uses IRB (Integrated Routing and Bridging) interfaces — equivalent to Cisco SVI (interface vlan X). JunOS uses 'family ethernet-switching' on access/trunk ports instead of Cisco's 'switchport' commands. RSTP (Rapid Spanning Tree) is enabled by default on EX switches — edge ports (equivalent to portfast) are configured per-interface.

When to use

  • ·Building L2 access layer with multiple VLANs on Juniper EX switches
  • ·Inter-VLAN routing on EX series using IRB interfaces
  • ·Replacing a Cisco Catalyst deployment with Juniper EX — same concepts, different syntax

When NOT to use

  • ·QFX series in data center fabric mode — use VXLAN/EVPN instead of traditional VLANs for large-scale DC deployments

How it compares

vs Cisco IOS VLANsCisco uses 'vlan database' or 'vlan <id>' under global config. Juniper uses 'set vlans <name> vlan-id <id>'. Cisco SVI = Juniper IRB. Cisco 'switchport mode trunk' = Juniper 'family ethernet-switching interface-mode trunk'.
vs Cisco NX-OS VLANsNX-OS is closer to Juniper in structure. Both use named VLANs referenced on interfaces. NX-OS uses 'feature interface-vlan' to enable SVIs; Juniper uses IRB interfaces natively.

Prerequisites

  • →JunOS version that supports 'family ethernet-switching' — EX series running 15.1 or later recommended
  • →VLAN IDs agreed across all switches before configuration
  • →IRB interfaces needed for each VLAN that requires L3 gateway

Config Generator

Verification commands

show vlans

Show all configured VLANs and their member interfaces

ExpectedLists VLANs with VLAN ID, member interfaces, and IRB interface if L3 is enabled

show interfaces irb.X

Verify IRB interface is up and has the correct IP

ExpectedShows 'Physical link is Up', IP address, and MAC address

show spanning-tree interface

Verify STP state on all interfaces

ExpectedAccess ports should show 'Edge' state. Uplinks should show 'Root' or 'Designated'.

Debug commands

show ethernet-switching table

Show MAC address table for all VLANs

Common mistakes & fixes

SymptomVLAN not passing traffic on trunk port
CauseVLAN not in the allowed list on the trunk port, or VLAN not defined globally
FixVerify 'show vlans <name>' shows the trunk interface as a member. Add VLAN to trunk: 'set interfaces <if> unit 0 family ethernet-switching vlan members <vlan-name>'.
SymptomIRB interface stays down
CauseNo active member interfaces in the VLAN, or L3 interface not linked to VLAN
FixVerify VLAN has 'l3-interface irb.<vlan-id>' configured. Check at least one access/trunk port in the VLAN is up: 'show vlans <name>'.

Further learning

Recommended books to go deeper on this topic.

CCNA 200-301 Official Cert Guide Library

Wendell Odom · Cisco Press · VLANs, trunk ports, DTP, VTP, inter-VLAN routing

CCNP Enterprise Core ENCOR 350-401 Official Cert Guide

Brad Edgeworth et al. · Cisco Press · Advanced switching — STP, RSTP, MST, PVST+

Related configs