L2 & L3 Vlan

Answered Question
Mar 4th, 2008

HI,

What is the differance between L2 Vlan and L3 Vlan ? How it will communicate each other.

I have this problem too.
0 votes
Correct Answer by lamav about 8 years 10 months ago

Sham:

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.

Example:

interface gi2/1

switchport

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.

Example:

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.

HTH

Victor

Correct Answer by Jon Marshall about 8 years 10 months ago

Hi

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 = 182.168.6.0/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.

HTH

Jon

  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 4 (3 ratings)
Loading.
Correct Answer
Jon Marshall Tue, 03/04/2008 - 23:50

Hi

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 = 182.168.6.0/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.

HTH

Jon

sham_chennala Wed, 03/05/2008 - 01:16

Hi,

In my switch both VLANS are present,L2 & L3.For L3 VLAN we are having ip address but L2 VLAN not having any ip address.then how it will communicate.

Thanks & Regards,

Sham.

Correct Answer
lamav Wed, 03/05/2008 - 10:04

Sham:

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.

Example:

interface gi2/1

switchport

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.

Example:

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.

HTH

Victor

mohanar82 Sun, 02/23/2014 - 23:11

Hi Sham,

You should have a default gateway created for your Layer2 Vlan (Just as your Layer 3 Vlan) which becomes a Layer 3 Vlan, that way both the Vlans will be able to communicate with each other.

Regards,

Mohana R.

Actions

This Discussion