Networking · Network Devices
Layer 2 Switch
Cheat sheet · https://pcornel.dk/topic.php?topic=540
Answer
A Layer 2 switch forwards Ethernet frames by MAC address within VLANs, learning source MACs per port, flooding unknown destinations, and using trunks and STP to connect to other switches.
Remember
- A Layer 2 switch forwards frames based on MAC addresses.
- It learns which MAC is on which port and floods unknown destinations.
- VLANs split it into separate broadcast domains.
First checks
show vlan brief— VLANsshow interfaces trunk— trunksshow spanning-tree summary— STPshow mac address-table— learning
Commands
show mac address-table- Displays learned/static MAC entries by VLAN and port.
ip default-gateway
Verify in this order
frame → VLAN → MAC lookup → forward
Where it usually breaks
physical/link dependency → local object state → peer/control state → policy → forwarding/adjacency → end-to-end result
Layer 2 Switch · operational reference
| State | Meaning |
|---|---|
| VLAN membership | Broadcast-domain context |
| MAC table | Learned L2 location |
| Trunk | VLAN transport |
| STP | Loop-free active topology |
Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=540