What is the differance between L2 Vlan and L3 Vlan ? How it will communicate each other.
I will try to add a bit to Jon's excellent post.
There is no such thing as a layer 2 or layer 3 vlan, per se. A vlan is a vlan, period. It is a virtual network that comprises one broadcast domain.
Now, given the ROLE that the switch is playing, the vlan configuration will differ.
For example, If you are configuring an ACCEESS switch that users will plug their PCs into directly, you will have to create the vlan first and then configure each user port to be placed in that vlan.
switchport mode access
switchport access vlan 10
This is a LAYER 2 configuration for VLAN 10.
Two devices that are part of the same vlan can communicate directly without a layer 3 vlan interface and an IP address.
However, if you want to communicate between 2 DIFFERENT vlans, then you will have to go through a router - a Layer 3 device. On that router, you will then configure the layer 3 routed vlan interface with an IP address on that vlan.
interface vlan 10
ip address 10.10.10.1 255.255.255.0
This is a LAYER 3 configuration for VLAN 10.
It may help you to think of the routed layer 3 vlan interface as a gateway OUT OF or INTO the vlan.
Take note, that you can configure a switch that is layer 3-capable to perform the tasks of an access switch and the inter-vlan router.
Vlans exist at layer 2. At layer 3 you have vlan interfaces. Vlan interfaces are only needed if you wanted to route between your vlans. So
vlan 10 = 192.168.5.0/24
vlan 11 = 188.8.131.52/24
On a switch you create vlan 10 and vlan 11 at layer 2 only.
Any PC connected into vlan 10 can communicate with any other Pc connected into vlan 10 and any PC in vlan 11 can communicate with any other PC in vlan 11 BUT
a PC in vlan 10 cannot communicate with a PC in vlan 11 and vice-versa.
If you want a PC in vlan 10 to be able to communicate with a PC in vlan 11 then you need to create a L3 interface for that vlan. Typically this is an SVI (Switched Virtual Interface) on a L3 switch. So you would
int vlan 10
ip address 192.168.5.1 255.255.255.0
int vlan 11
ip address 192.168.6.1 255.255.255.0
Then you would set the default-gateway of a PC in vlan 10 to be 192.168.5.1 and the default-gateway of a PC in vlan 11 to be 192.168.6.1 and PC's in vlan 10 and vlan 11 can now talk to each other.