Configure VLANs in Juniper Switch

Configuration of VLANs in Juniper switches is different from Cisco switches. VLAN (Virtual Local Area Network) is a logical LAN that have separate broadcast domain. VLAN is often called LAN virtualization. VLAN groups ports of the switch and each group are given different VLAN-ID and VLAN name. The groups acts like different switch logically. You can extend the VLAN capability of one switch by interconnecting two or more switches via trunk ports. Trunk ports are type of ports that pass multiple VLAN traffic between switches. Trunk ports are also called tagged ports and operates IEEE 802.1Q protocol. Configuring VLANs in JunOS can be difficult if you are configuring it for the first time.

In Juniper switches, there is no VTP (VLAN Trunking Protocol) or DTP (Dynamic Trunking Protocol) protocols. For managing VLANs GVRP(GARP VLAN Registration Protocol) is used in Juniper switches. If you are connecting Cisco switches with Juniper switches then disable VTP in Cisco switch. The VTP mode in Cisco switch must be transparent (which means disabled).

Configure VLANs in Juniper Switch

Let’s hit some VLAN commands in EX 2200 Juniper switch. The diagram below shows two EX 2200 switches. We will create two VLANs in both the switches and configure  trunk ports between these switches.

Configure vlan 10 as Marketing and vlan 20 as Finance on both switches. Start with switch A.

root@MustBeGeekA# set vlans marketing vlan-id 10 (This command will create VLAN named marketing with VLAN-ID of 10)
root@MustBeGeekA# set vlans finance vlan-id 20 (This command will create VLAN named finance with VLAN-ID of 20)
root@MustBeGeekA# commit

Same in Switch B,

root@MustBeGeekB# set vlans marketing vlan-id 10
root@MustBeGeekB# set vlans finance vlan-id 20
root@MustBeGeekB# commit

To view the created VLANs issue following command,

root@MustBeGeekA# run show vlans
root@MustBeGeekB# run show vlans

Make the interfaces ge-0/0/11 and ge-0/0/12 member of it’s corresponding VLANs

[edit interfaces ge-0/0/11]
root@MustBeGeekA# set unit 0 family ethernet-switching vlan members marketing
[edit interfaces ge-0/0/12]
root@MustBeGeekA# set unit 0 family ethernet-switching vlan members finance
[edit interfaces ge-0/0/12]
root@MustBeGeekA# commit

Do the same in Switch 2,

[edit interfaces ge-0/0/11]
root@MustBeGeekB# set unit 0 family ethernet-switching vlan members marketing
[edit interfaces ge-0/0/12]
root@MustBeGeekB# set unit 0 family ethernet-switching vlan members finance
[edit interfaces ge-0/0/12]
root@MustBeGeekB# commit

Issue “show vlans” command to view VLANs and its member interfaces on both switches

root@MustBeGeekB> show vlans

We have configured VLAN names, its IDs and assigned ports to VLANs. Now configure trunk ports for VLAN tagging. To configure ports as Trunk, hit the following command in both switches,

[edit interfaces ge-0/0/10]
root@MustBeGeekA# set unit 0 family ethernet-switching port-mode trunk
[edit interfaces ge-0/0/10]
root@MustBeGeekA# set unit 0 family ethernet-switching vlan members all (All vlans will pass through this trunk, but will not pass untagged frames)
[edit interfaces ge-0/0/10]
root@MustBeGeekA# set unit 0 family ethernet-switching native-vlan-id 10 (This command will now allow the switch to accept untagged frames)

Do same on Switch B

[edit interfaces ge-0/0/10]
root@MustBeGeekB# set unit 0 family ethernet-switching port-mode trunk
[edit interfaces ge-0/0/10]

root@MustBeGeekB# set unit 0 family ethernet-switching vlan members all (All vlans will pass through this trunk, but won’tt pass untagged frames)

[edit interfaces ge-0/0/10]
root@MustBeGeekB# set unit 0 family ethernet-switching native-vlan-id 10 (This command will now allow untagged VLANs)

To view information of native VLAN

root@MustBeGeekA> show vlans native

To show list of Ethernet switching interfaces,

root@MustBeGeekA> show ethernet-switching interfaces

References

  1. Configuring VLANs for EX-series Switches – Juniper.net
  2. EX2200 Switch – Juniper.net