Pcornel
Networking · Network Devices

Layer 2 Switch

Cheat sheet · https://pcornel.dk/topic.php?topic=540

Back to the Topic

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 — VLANs
  • show interfaces trunk — trunks
  • show spanning-tree summary — STP
  • show 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

StateMeaning
VLAN membershipBroadcast-domain context
MAC tableLearned L2 location
TrunkVLAN transport
STPLoop-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

Confirmation

Confirm action

Continue?