0

I am studying for my Networking exam and from what I have pieced together from other posts on here is this. Please correct me if I'm wrong:

  1. Layer 2 switches can only route packets between different subnets or VLANs if the two MAC addresses are both PHYSICALLY connected to the layer 2 switch and

  2. A packet to a device with a MAC not PHYSICALLY connected with the layer 2 switch must run through the gateway.

closed as off-topic by Ron Trunk, Ron Maupin Aug 30 '18 at 21:22

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "NE is a site for to ask and provide answers about professionally managed networks in a business environment. Your question falls outside the areas our community decided are on topic. Please visit the help center for more details. If you disagree with this closure, please ask on Network Engineering Meta." – Ron Trunk, Ron Maupin
If this question can be reworded to fit the rules in the help center, please edit the question.

  • Routing happens at layer-3 with layer-3 packets, not at layer-2 with layer-2 frames. To get traffic between VLANs, you must route the packets through a router. – Ron Maupin Aug 30 '18 at 18:45
  • Unfortunately exam and certification questions are off topic here. But my answer still stands. You seem to have understood it. – Ron Trunk Aug 30 '18 at 19:52
2

Welcome to NE! We hope you will become a contributing member of this community.

To answer your specific questions:

Layer 2 switches can only route packets between different subnets or VLANs if the two MAC addresses are both PHYSICALLY connected to the layer 2 switch

No. Routing is a layer 3 function. Switches do not route. Switches forward frames based on MAC address, and ports have to be in the same VLAN -- Never between different VLANs.

A packet to a device with a MAC not PHYSICALLY connected with the layer 2 switch must run through the gateway.

When a switch forwards a packet, it looks up the mac address in its forwarding table to determine which port the packet should be forwarded to. If the MAC is not listed in the table, the switch will forward the packet out all ports (in the same VLAN).

  • This is the COMP Tia Networking practice question from which I formulated my idea – billnyeguy Aug 30 '18 at 19:44
  • Thank you Ron for your kind welcome. I really appreciate the help also. – billnyeguy Aug 30 '18 at 19:59
1
  1. Layer 2 switches can only route packets between different subnets or VLANs if the two MAC addresses are both PHYSICALLY connected to the layer 2 switch and

Wrong. Layer-2 switches don't route packets between different VLANs at all. Only routers route packets between subnets. Switches forward frames only within each segment or VLAN. Layer-3 switches with appropriate configuration also work as routers.

  1. A packet to a device with a MAC not PHYSICALLY connected with the layer 2 switch must run through the gateway.

The physical - or direct - connection doesn't matter. You can forward a frame through an arbitrarily long chain of layer-2 switches as long as all ports are member of the same segment or VLAN.

You can even bridge frames across a wireless link built with access points (or anything else that can transport Ethernet compatible frames like VDSL, or a L2 tunnel).

  • Thank you Zac67, the practice question I added above mentions Layer 2 routing which is what is getting me, does such a term exist? – billnyeguy Aug 30 '18 at 20:01
  • 1
    "Routing" is only used for layer-3 based forwarding like based on (globally valid) IP addresses. It involves constructing a potentially lengthy path hop-by-hop. Layer-2 forwarding is called just that, "switching", or sometimes "bridging". On Ethernet and many other layer-2 implementations, forwarding is based on (only locally valid) MAC addresses. – Zac67 Aug 30 '18 at 20:29

Not the answer you're looking for? Browse other questions tagged or ask your own question.