BuildTheNet

Opening your workspace

Your learning content and tools are loading.

Switching Basics

show mac address-table

Shows which MAC addresses the switch has learned, in which VLAN, on which port.

Written by a working field network engineer · CCNA, Security+, CySA+

Shows what the switch has learned: for each VLAN, which MAC address lives behind which port. It answers “where is this host plugged in?” and explains why a frame was forwarded, flooded or filtered.

Example output

SW1#show mac address-table
          Mac Address Table
-------------------------------------------

Vlan    Mac Address       Type        Ports
----    -----------       --------    -----
  10    0050.7966.6812    DYNAMIC     Gi0/1
  10    0050.7966.6817    STATIC      Fa0/1
  10    0050.7966.6818    STATIC      Fa0/2
  20    0050.7966.6820    DYNAMIC     Po1
Total Mac Addresses for this criterion: 4

Reference output: hand-written in standard Cisco IOS format for this example network, not captured from a device.

Useful variants

What each column or field means

FieldMeaning
VlanThe VLAN the address was learned in. The same MAC can appear in more than one VLAN.
Mac AddressThe source MAC address of frames received, in Cisco dotted format.
TypeDYNAMIC (learned, ages out after 300 seconds by default) or STATIC (configured, or a port-security secure address: Fa0/1 and Fa0/2 both run port security here).
PortsThe port frames to this MAC are sent out of. A trunk or port-channel here means the host is on another switch.

When it doesn’t look right

A host’s MAC is missing.

The switch has not received a frame from it (silent host, wrong VLAN, port down) or the entry aged out. Ping the host to make it send, then look again.

The same MAC keeps moving between two ports.

MAC flapping usually means a Layer 2 loop or a host dual-homed without teaming. Check show spanning-tree for a port that should be blocking.

Hundreds of MACs on one access port.

Either an unmanaged switch or hub is attached, or a MAC flooding attack is in progress. Port security limits the count.

Related commands

Try it yourself

Learn it in the CCNA path

Topic

Switching Basics — How a switch learns MAC addresses, how to read interface status, and how to fix speed, duplex and administratively down ports.

All 57 commands