Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements

Welcome to Cisco Support Community. We would love to have your feedback.

For an introduction to the new site, click here. And see here for current known issues.

New Member

L2 & L3 Vlan

HI,

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

2 ACCEPTED SOLUTIONS

Accepted Solutions
Hall of Fame Super Blue

Re: L2 & L3 Vlan

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

Blue

Re: L2 & L3 Vlan

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

5 REPLIES
Hall of Fame Super Blue

Re: L2 & L3 Vlan

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

New Member

Re: L2 & L3 Vlan

Thanks for your valueable replay.

Thanks & Regards

Sham

New Member

Re: L2 & L3 Vlan

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.

Blue

Re: L2 & L3 Vlan

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

New Member

L2 & L3 Vlan

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.

9290
Views
5
Helpful
5
Replies
CreatePlease login to create content