Monday, August 18, 2008

VLAN tags - How to make your switch Virtual

So you are an entry level IT person, maybe the only IT person in your company.  You need to deploy a virtual infrastructure on a budget that can't have too much in the way of extras.  One way to save some coin, and this is also used in very large installations as well, is to use VLANS.  For some reason, VLANS are still thought of as voodoo, or some type of black magic by quite a few network admins.  They don't totally understand what VLANS (Virtual Lans) are, or how they work.  In layman's terms, all a vlan is a logical seperation of your physical lan into multiple virtual segments.  This allows two ports on the same switch to by virtually isolated from one another.  One could be on say vlan 10, while the other is on vlan 20, etc.  Placing a switchport into a VLAN is rather simple.  Below is the syntax for creating a vlan, and assigning it to an interface.

First you want to instantiate the vlan.  This can be done a couple different ways, however this is how I prefer to do it.

Enter enable, and config terminal mode.

>vlan 20
vlan20>description Internet VLAN
vlan20>exit
>

That is all you have to do to create a VLAN, now lets tie it to an interface.
>int FastEthernet0/0
FE0/0>switchport mode access
FE0/0>switchport access vlan 20
FE0/0>exit
>
wr

Thats it.  That is how you create a vlan, and tag an interface.  Be sure that if you need to pass traffic between two vlans, you must place a routing device between them.

No comments: