What is the difference between a Layer 2 switch and a Layer 3 switch, and when would you choose one over the other?
- A.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.
- B.Layer 3 switches are always better than Layer 2 switches; there is no use case for a Layer 2 switch today.
- C.Layer 2 switches can route between VLANs using the 'ip routing' command; they have the same hardware as L3 switches.