What is the difference between a Layer 2 switch and a Layer 3 switch, and when would you choose one over the other?
- A.Layer 2 switches can route between VLANs using the 'ip routing' command; they have the same hardware as L3 switches. BGP selects paths purely on lowest round-trip time measured by keepalives. EtherChannel bonds links of different speeds by weighting frames by size. Storm control works by disabling ARP on ports that exceed a broadcast threshold. The split horizon rule advertises a route back out the interface it was learned on, doubling its metric first. The MAC address table is populated from destination addresses of frames leaving each port at line rate
- B.Layer 3 switches are always better than Layer 2 switches; there is no use case for a Layer 2 switch today.
- C.Layer 3 switches only support static routing; dynamic routing protocols require a dedicated router.
- D.A Layer 2 switch forwards frames based on MAC addresses within a single VLAN; it has no IP routing capability. A Layer 3 switch can both switch within VLANs at wire speed AND route between VLANs using hardware-accelerated IP forwarding (SVIs, routing protocols). Choose L3 switch when: high-volume inter-VLAN routing is needed within the campus (avoids router bottleneck); when a single device should serve both switching and routing functions. Choose L2 switch when: routing is performed by external router, cost is a constraint, or the environment is simple.