• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 309
  • Last Modified:

Usage of Layer2/Layer3 Switch

As far as I know, Layer 2 switch can be split into Vlans and those Vlans will form different subnets, and the L2 switch can be trunked from one port to the router port to make all the vlans talk to each other.
Layer 3 switch, from what I have heard it works like a router, but how it does.??
If I have a LAyer 3 switch with 48 ports.Does that mean I can create Vlans and will be able to talk to each other without a need for  trunk to the router?

Thanks
0
jskfan
Asked:
jskfan
  • 10
  • 7
  • 4
2 Solutions
 
that1guy15Commented:
You are correct. A L3 switch is basically a switch and router combined. You can create VLANs on it and then also route between the VLANs without the use of a router.

An L3 switch is able to do this because it stores both a L2 mac address table (CAM table) and a L3 routing table (FIB table). You can also utilize L3 routing protocols on a L3 switch such as OSPF, EIGRP (cisco only), BGP and others.

0
 
Don JohnstonInstructorCommented:
Be careful of the term Layer 3 switch. There aren't many layer 3 switches anymore. A true layer 3 switch is nothing more than a very fast router with only ethernet ports. The devices that most people mean when they say "Layer 3 Switch" is actually a multilayer switch. Capable of layer 2 and layer 3 operations.

The easiest way to think about a multilayer switch is to first start out with a regular layer 2 switch that has all the normal features of a layer 2 switch (VLANs, trunks, etherchannel, spanning-tree, etc.).

Then put a router inside of the switch. The connection between the router and the switch is over the internal backplane of the switch (usually measured in multi-gigabit speed). that can carry all VLANs.

For intra-VLAN traffic, the standard layer-2 switching operations are performed. But inter-VLAN traffic is sent to the (internal) router to handle.


0
 
jskfanAuthor Commented:
is there any series number that Multi layer switch starts from, so that we can tell if it's multi layer switch or layer2 just by koojing at it from outside the box?
when you configure routing between vlans in layer, you need to specify which port is a trunk and which vlans can route traffic through that trunk.
 how do you do that in layer 3.?
0
Cloud Class® Course: Amazon Web Services - Basic

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

 
Don JohnstonInstructorCommented:
>is there any series number that Multi layer switch starts from

No. In the Cisco product line, the layer 3 switches end with "L3". As in 3548G-L3.

> how do you do that in layer 3.?

Same way you do with a router. Remember, a layer three switch IS a router. Just really fast. :-)
0
 
jskfanAuthor Commented:
in routers, if I remember you create a sub-interface for each vlan, is it the same in L3 switch?
L3 switch might have just ethernet ports, how do you do that?
if you don't mind please paste the code on how to configure Vlans to talk to each other.
0
 
Don JohnstonInstructorCommented:
>                Was this comment helpful?                         Yes               No                                 jskfan:             in routers, if I remember you create a sub-interface for each vlan, is it the same in L3 switch?

Yes.

>L3 switch might have just ethernet ports, how do you do that?
None of Cisco's Layer3 switches have ethernet ports. Only FastEthernet and GigabitEthernet ports.

>if you don't mind please paste the code on how to configure Vlans to talk to each other.
On a layer 3 switch? Just like you do on a router.

int f0/1.1
 encap dot1q 1
 ip address x.x.x.x y.y.y.y
int f0/1.2
 encap dot1q 2
 ip address x.x.x.x y.y.y.y

etc.
0
 
jskfanAuthor Commented:
<<ip address x.x.x.x y.y.y.y>>>

is it gonna be the same as the IP address configured on  the VLAN interface?
0
 
Don JohnstonInstructorCommented:
What VLAN interface?
0
 
jskfanAuthor Commented:
on the switch you are going to create a VLAN (VLAN10) and add tghe rnage of ports to it, then assign it an IP address. (10.10.10.10)
in the router subinterface you are going to create a trunk port and give it the same address as 10.10.10.10 ???
if you don't mind try to paste the code on ho wto create vlans on the switch, assign ithem IPs and how to trunk them to a router subinterface.
that's a lot but I appreciate it.
0
 
Don JohnstonInstructorCommented:
On a layer 2 switch you don't assign IP addresses to VLANs. It's a layer TWO switch. The only IP address on a layer 2 switch is for management.

0
 
jskfanAuthor Commented:
canyou just drop the code here on ho wto create vlans on a switch and how to trunk them to the router?
0
 
Don JohnstonInstructorCommented:
vlan 10
vlan 20
vlan 30
int f0/1
 switchport trunk encap dot1q
 switchport mode trunk

0
 
jskfanAuthor Commented:
I know that it takes time to type the whole configuration.
whenever you get a chance can you do it? no rush..
0
 
Don JohnstonInstructorCommented:
No.

To create a full config for your switch would require more information. The topology of the network (what devices are connected to what ports, IP addresses, etc., etc., etc.,).

Way beyond the scope this question and format.
0
 
jskfanAuthor Commented:
you can just set up an example:
Switch1 has 24 ports we nee 3 vlans of 5 ports each, to talk to each other. That's it.
0
 
Don JohnstonInstructorCommented:
What model switch?
What version IOS?
What are the VLANs (numbers)?
What ports will be in what VLANs?
What port will be connected to the router?
What model router?
What version IOS?
What port will be connected to the switch?
Will the router be connected to any other devices?

0
 
that1guy15Commented:
Oh a whole lot going on here!! Lets take a step back for a second and see if we can get this solved.

Creating VLANs on a L3 switch is done the exact same way as an L2 switch. In fact VLANs and ports on an L3 switch only run at L2 until you configure them to run at layer three.

donjohnston was correct on how to create the VLANs and set them up as trunk ports. But on a L3 switch you do not need to create sub-interfaces and trunk VLANs. All you need to do is set the VLAN up with an IP address. This creates a SVI (switched virtual interface) for the vlan that runs at layer three and allows traffic to flow between VLANs. The IP address should reside in the same subnet as the VLAN and all devices in the VLAN should point to that IP for a gateway. That is all that needs to be done to route VLANs on a L3 switch.

Oh forgot you must first enable IP routing :)

Here is a sample of what it would look like with two VLANs

vlan 100
vlan 200 <---creates the vlans
interface range f0/1 - 5
switchport mode access
switchport access vlan 100 <---assignees port 1 - 5 to vlan 100

interface range f0/6 - 12
switchport mode access
switchport access vlan 200 <---assigness port 6 - 12 to vlan 200

ip routing <---enables IP routing

int vlan 100
no switchport <---enables L3 capabilities
ip address 10.0.0.1 <--this will be VLAN 100s default gateway

int vlan 200
no switchport
ip address 10.0.100.1


Traffic will now be able to flow between vlan 100 and 200.
0
 
that1guy15Commented:
woops correction:

int vlan 100
no switchport <---enables L3 capabilities
ip address 10.0.0.1 255.255.255.0<--this will be VLAN 100s default gateway

int vlan 200
no switchport
ip address 10.0.100.1 255.255.255.0
0
 
Don JohnstonInstructorCommented:
>Creating VLANs on a L3 switch is done the exact same way as an L2 switch.

You cannot create VLANs on a layer-3 switch. You can only do this on a layer-2 and a multi-layer switch.

0
 
that1guy15Commented:
donjohnston:

I think we are using two different terms for the exact same thing. When I say L3 switch i mean a multi-layer switch such as a 3550 or 3560.

0
 
Don JohnstonInstructorCommented:
> When I say L3 switch i mean a multi-layer switch such as a 3550 or 3560.

And that can create some confusion.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 10
  • 7
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now