Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Inter VLAN Routing with a mix of Layer 2 and Layer 3 Switches

Status
Not open for further replies.

beatdown

Technical User
Feb 27, 2005
85
US
Hi all,

I've got a basic Layer 3 switching question here...

I have three switches in the network - two of them are layer 2 switches, and one is a layer 3 switch. We have two VLAN's.

I know that you can use a layer 3 switch to do the inter VLAN routing (as opposed to router on a stick), but what I'm confused about is whether all your switches have to be layer 3, or if only one of them has to be layer 3?

So if a VLAN 1 device that is connected to one of the layer 2 switches needs to communicate with a VLAN 2 device, how will it route the traffic through the layer 3 switch?

I'm not understanding how this would work, given that each devices default gateway is our firewall, not the layer 3 switch.

Thanks to anyone who can help explain this to me!
 
You only need one layer 3 switch or router to do your routing. Your layer 2 switches will have uplink ports (trunks) that will pass the layer 2 frames to it's connecting switch and/or router. As long as the vlan traffic flows through your trunks properly, the router will be able to route them properly.

So for example image that SW1 is a layer 2 switch and SW2 is a layer 3 switch:

SW1 <--------> SW2 (Layer 3)

Ports on SW1:
int fa0/1
switchport access vlan 1
int fa0/2
switchport access vlan 2
int fa0/24
switchport mode trunk

SVIs on SW2:
int Vlan1
ip address 1.1.1.1 255.255.255.0
int Vlan2
ip address 2.2.2.2 255.255.255.0

Assuming host 1 and 2 use the layer 3 switch as their default gateway:
In order for the host plugged into port 1 to ping a host plugged into port 2, it's traffic will traverse the trunk to the layer 3 switch SW2. SW2 will forward (route) the packet to vlan 2 which will then traverse back down the trunk to SW1 and exit port fa0/2.
 
No you don't, the layer 2 switch does not make any layer 3 decisions. The trunk determination will be made based upon spanning tree and mac address table on a per vlan basis.
 
No Gateway is required on a layer 2 switch.

The dot1q trunk will handle all the traffic not designated for the access ports. It will add it's 4 byte tag to the front of the packet that carries the ID and the far end ingress removes the tag for egress into the switch and then egress out of the designated ports, or re-tag for another trunk.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top