This is the first in a series of blog posts covering some of the basics of Junos. In this post I’ll be covering the process of creating VLAN’s on a Juniper switch and assigning interfaces to them. The model of switch I am using is an EX2200-C, running Junos 11.4R1.6.
Creating the VLANs’s is very simple. In this example we’ll create 2 VLAN’s, SALES and IT with VLAN ID’s 100 and 200 respectively.
In configuration mode:
set vlans SALES vlan-id 100 set vlans IT vlan-id 200
After committing the configuration we can now view our list of VLAN’s:
rich@EX2200C# show vlans IT { vlan-id 200; } SALES { vlan-id 100; }
Next we’ll assign an interface to each VLAN. There are two methods of doing this – you can configure the interface to be a member of a VLAN or you can configure a VLAN to have an interface as a member.
Method 1 – configure the interface:
set interfaces ge-0/0/0 unit 0 family ethernet-switching vlan members SALES
This assigns the interface to the VLAN SALES which can be seen from the interface configuration:
rich@EX2200C> show configuration interfaces ge-0/0/0 unit 0 { family ethernet-switching { vlan { members SALES; } } }
Method 2 – Configure the VLAN:
set vlans IT interface ge-0/0/1.0
This method is much quicker and simpler than method 1 and the end result is the same. The difference is that the VLAN membership is not apparent when you view the configuration of the interface:
rich@EX2200C> show configuration interfaces ge-0/0/1 unit 0 { family ethernet-switching; }
Instead, to verify our configuration we need to view the list of VLAN’s again:
rich@EX2200C> show vlans Name Tag Interfaces IT 200 ge-0/0/1.0 SALES 100 ge-0/0/0.0 default ge-0/0/2.0, ge-0/0/3.0, ge-0/0/4.0, ge-0/0/5.0, ge-0/0/6.0, ge-0/0/7.0, ge-0/0/8.0, ge-0/0/9.0, ge-0/0/10.0, ge-0/0/11.0, ge-0/1/0.0, ge-0/1/1.0
Another verification option is the “show ethernet-switching interfaces” command:
rich@EX2200C> show ethernet-switching interfaces Interface State VLAN members Tag Tagging Blocking ge-0/0/0.0 down SALES 100 untagged blocked by STP ge-0/0/1.0 down IT 200 untagged blocked by STP ge-0/0/2.0 down default untagged blocked by STP ge-0/0/3.0 down default untagged blocked by STP ge-0/0/4.0 down default untagged blocked by STP ge-0/0/5.0 down default untagged blocked by STP . .
Note also that now we have assigned some interfaces to VLAN’s, all the other interfaces appear as members of the “default” VLAN.
In my next post I’ll cover routing between the VLANS’s we’ve created here.
I hope this has been a useful explanation. Thanks for reading.
Rich
Follow Rich on Twitter