Since I recently acquired my own EX4200 and EX3200 Series switches I have had a chance to sit down and play around with them a bit, and have come up with some VLAN configuration examples. This is very basic, but since this is a new function to JUNOS, I figured it was somewhat important.
I am assuming you have a basic knowledge base of JUNOS, and know how to get into a box. So without further a due, I would like to start.
Basic VLAN Config:
root@switch# set vlans <vlan-name> vlan-id <vlan#>
Make the VLAN you just created part of an Interface:
root@switch# set interfaces <interface> unit 0 family ethernet-switching vlan members <vlan#>
Great! Now we have created a VLAN and made it a part of an Interface! If you are making a simple VLAN you are one step away from having a working VLAN! Now you need to tell the interface your VLAN is apart of whether it will be trunking on this interface or if it will be an access interface.
Configure your port for Trunk or Access:
root@switch# set interfaces <interface> unit 0 family ethernet-switching port-mode <access or trunk>
Awesome! Now for a basic VLAN, i.e. switch to switch and switch to PC Operations you have successfully built a VLAN, and assigned it to a port. You have also told the port how to treat VLANS assigned to it, with the trunk or access commands!
Now lets imagine we are in a bit more of an advanced Network and we need to assign an IP Address to our VLAN. In Cisco terms we would do an "interface vlan XXX" and in Foundry we would do a "router-int ve xxx". In Juniper it is a bit different, but follows the same principles.
Assign an IP Address to a VLAN, and create an Interface VLAN:
root@switch# set interfaces vlan unit <vlan#> family inet address <ip addr/subnet>
root@switch# set vlans <vlan-name> l3-interface vlan.<vlan#>
The First command here assigns an IP Address to your VLAN, similar in Cisco to doing "int vlan XXX" then assigning an IP Address to it. The IP Information goes in like so "220.127.116.11/24" For those in the industry, this is CIDR notation. If you are not sure of the CIDR notation for your specific IP Address, please take your IP Address and Subent Mask and google a Subnet Calculator. Plug in your info and you should be able to find out the CIDR Notation for your specific use.
The second commnd here tells the VLAN it is a routebale VLAN. The last command does go "vlan.xxxx" You MUST HAVE THE "." before the vlan number.
For those of us who will use "Super Tags" or Q-in-Q:
root@switch# set interfaces <interface> unit 0 vlan-tags inner <vlan#> outter <vlan#>
If anyone has any questions about switching with these please ask away in the switch forum section. I realize these are still brand new pieces of gear, but I have a feeling they will get more and more popular.
I will come back and add some pictures of the devices later on, once I get my cam. home.