Pcornel
Browse topics
Options
Recent
Favorites
Networking · Technical reference

MAC Learning

Direct answer

A switch learns MAC addresses from the source address of each frame and stores them per VLAN with the ingress port. Frames to a known MAC go out only that port; unknown unicast, broadcast and multicast are flooded within the VLAN.

When to use this

Use it when traffic to one host fails, a host appears on the wrong port, or MAC addresses flap between ports.

First 30 seconds

1. show mac address-table address <mac> — learned? In the right VLAN, on the expected port?

2. Not learned → the host sends nothing, or a port / VLAN / port-security problem.

3. On an uplink → follow it to the next switch with CDP/LLDP and repeat.

4. MAC flapping in the log → look for a loop (STP) or dual-homed host.

5. Table full → show mac address-table count.

Operational verification

frame arrives → source MAC learned with VLAN and port → destination looked up → known: forwarded out one port; unknown: flooded in the VLAN → entry refreshed while traffic continues

Context & applicabilityCommon mistakes · platform/version boundaries
Platform / version applicability
Cisco IOS / IOS XE
applies
Structured applicability is explicit Topic metadata; it does not infer compatibility beyond the stored rows.
At a glance

Operational reference

Fast context before you go deeper.

PlatformCisco IOS / IOS XE · IOS/IOS XE · Cisco IOS XE
Key commandmac address-table aging-time <seconds>
Scope / prerequisiteUse it when traffic to one host fails, a host appears on the wrong port, or MAC addresses flap between ports.
Show · 3Reference · 3
What next?3 suggested next steps
Child topics (this level)4
Catalog command links6
Evidence0
On this pageJump to a specific section
Cisco IOS / IOS XE first

Primary Commands

Configuration and operational commands for this Topic.

Verification

Show Commands

Read-only Cisco show commands for confirming state, narrowing a fault and interpreting the current boundary.

How to read the output

show mac address-table [dynamic]

Look first: VLAN, MAC, type, learned interface

Healthy: Endpoint MAC is learned in expected VLAN/interface.

Warning: Missing, flapping or learned on unexpected interface/VLAN.

Does not prove: MAC learning does not prove ARP/IP routing or application reachability.

show mac address-table

Look first: VLAN, MAC, type, learned interface

Healthy: Endpoint MAC is learned in expected VLAN/interface.

Warning: Missing, flapping or learned on unexpected interface/VLAN.

Does not prove: MAC learning does not prove ARP/IP routing or application reachability.

show mac address-table interface <interface>

Look first: VLAN, MAC, type, learned interface

Healthy: Endpoint MAC is learned in expected VLAN/interface.

Warning: Missing, flapping or learned on unexpected interface/VLAN.

Does not prove: MAC learning does not prove ARP/IP routing or application reachability.

show mac address-table dynamic

Look first: VLAN, MAC, type, learned interface

Healthy: Endpoint MAC is learned in expected VLAN/interface.

Warning: Missing, flapping or learned on unexpected interface/VLAN.

Does not prove: MAC learning does not prove ARP/IP routing or application reachability.

Operational workflow

Verification & Troubleshooting

Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.

9 steps Observe → verify → isolate → change minimally → repeat the original test.
ObservedRecord what the original test actually shows

Capture the concrete output, symptom, packet, log or counter before changing anything.

Step 1 Layered verification and original-test closure Verify boundary

MAC Learning — Generate one controlled frame from the endpoint, confirm the MAC appears on the expected VLAN/interface, then verify destination forwarding and the return path before declaring the L2 path healthy.

Step 2 MAC learning: readback, negative test and recovery Verify boundary

Illustrative entry, not a device capture:

Vlan  Mac Address     Type      Ports
20    0011.2233.4455   DYNAMIC   Gi1/0/10

This means VLAN 20 learned source MAC 0011.2233.4455 via Gi1/0/10. A new source transmission should refresh learning there unless topology or policy legitimately changes its location. Verify the expected opposite endpoint and frame exchange independently.

In an isolated lab, compare VLAN 20 with another VLAN carrying no traffic from that source: an entry in VLAN 20 does not imply an entry in the other VLAN. For an aging test, stop source transmissions and observe expiry using the configured aging behavior, allowing for background endpoint traffic. Resume transmission and verify relearning. Static/secure entries need their own rules.

Do not use a global clear as the negative test. Cleared dynamic entries cannot be restored by configuration rollback; they are relearned from subsequent source traffic. If a configuration change is needed, restore the exact previous VLAN/trunk/STP setting and recheck both intended traffic and an unaffected VLAN. No executed lab or new verification is claimed.

Step 3 Operational verification and known-good state Verify boundary

To verify a MAC-learning path, fix the VLAN and MAC first—same MAC values can legitimately exist in separate bridge domains. Use show mac address-table and, when useful, show mac address-table interface <interface> or dynamic filters to locate the entry. Check whether it is dynamic, static/secure and whether the egress is the intended physical port or port-channel. Then verify the VLAN is allowed/active and STP forwards on that egress. Generate one controlled frame from the endpoint and confirm the source entry refreshes without moving unexpectedly. Cross-check the peer switch so the return direction learns a coherent path rather than assuming one switch table shows the entire Layer-2 journey.

Step 4 Verification and output interpretation Verify boundary

Use show mac address-table or a filtered lookup for the exact MAC and VLAN. A dynamic entry on the expected port shows that the switch recently received a frame whose source address was that MAC in that VLAN. Compare the learned port with the access/trunk/EtherChannel topology and use interface counters to confirm the port is actually receiving traffic. Repeated movement between ports can indicate a legitimate endpoint move, virtualization behavior, topology instability or a Layer-2 loop, so the move itself is a symptom rather than a root cause. If the destination is not learned, capture whether frames from that source ever arrive at this switch before blaming the FDB. For end-to-end forwarding, pair the MAC lookup with VLAN/STP state and, where routing is involved, ARP/ND and L3 forwarding evidence. A correct MAC entry is one link in the path, not the whole path.

Step 5 MAC learning: absent, unexpected and moving entries Narrow the fault

1. Entry absent: verify the endpoint has transmitted a source frame recently, access VLAN or tagged VLAN is correct, and each hop carries that VLAN. Compare show interfaces <interface> switchport, show interfaces trunk and show spanning-tree vlan <vlan-id>. Absence after inactivity can simply be normal aging.

2. Entry on an unexpected port: trace the same VLAN/MAC across adjacent switches and compare cabling, port-channel membership and endpoint placement. A remote endpoint should appear behind an uplink; that alone is not a fault.

3. Entry moves repeatedly: correlate timestamps with physical links, topology changes, mobility, duplicate MAC use and loop symptoms. Moves suggest a hypothesis, not automatic evidence of a loop. A logical port-channel entry must not be confused with per-flow member selection.

4. Entry is stable but traffic fails: check the destination's learned location and frame path. For routed traffic, separately inspect gateway ARP, routing and return traffic. A MAC entry alone cannot show these layers.

Collect before/after observations around one bounded endpoint transmission rather than flushing the table. Platform-specific logging, aging visibility and counters may differ; do not invent an age field where the command does not display one.

Step 6 Verification & troubleshooting Narrow the fault

1. Confirm ingress VLAN and STP forwarding state.

2. Verify source MAC learning.

3. Inspect destination MAC entry/type/age.

4. Trace trunk VLAN allowance to egress.

5. Check counters, security features and return learning.

Step 7 Observation → implication → next check Narrow the fault

MAC Learning — If an expected MAC is missing, verify traffic actually arrives in the VLAN and the port is forwarding. If the MAC moves repeatedly, correlate timestamps and interfaces; if learned correctly but traffic fails, inspect egress state.

Step 8 Failure signatures and troubleshooting branches Narrow the fault

If the source never appears, inspect whether frames actually enter the switch, whether the port is in the intended VLAN and forwarding state, and whether port-security/802.1X or other controls block them. If the MAC appears on the wrong interface, follow the Layer-2 path and look for trunk/native-VLAN errors, loops, patching mistakes, endpoint bridging, virtualization movement or spoofing. Rapid MAC flaps should be correlated with STP topology changes and EtherChannel state before disabling ports. If the MAC remains correct but ARP or IP traffic fails, move upward to adjacency/routing/policy. Clearing the table is a mutation that can create flooding and erase movement/age evidence; use it only as a controlled test after capturing state.

Step 9 When the problem is really fixed Narrow the fault

A successful remediation leaves the MAC stably learned on the intended logical egress in the correct VLAN while the original endpoint flow succeeds in both directions. Validate that the entry refreshes from real source traffic and that upstream/downstream switches show a coherent path. If the change touched trunks, STP or port-channels, test another VLAN/endpoint to detect regression. A MAC-table entry is bounded Layer-2 forwarding evidence: it does not show ARP correctness, Layer-3 reachability, ACL/NAT state, server health or application success. Do not synthesize observed Evidence from the authored examples in this Topic. Where MAC movement was part of the failure, observe at least one normal aging or controlled source refresh and confirm no new move/flap event appears. This separates durable topology correction from a momentary table snapshot.

Command lookup Jump straight to Cisco syntax
Drill down

Subtopics

Go one level deeper into this subject.

Key points

Entries age out after 300 seconds by default. A MAC that moves between ports repeatedly (MAC flapping) usually means a loop or a misconnected dual-homed server. Port security can limit or block learning on a port.

Key checks
  • show mac address-table address <mac> — VLAN and port the MAC is learned on.
  • show mac address-table interface <if> — MACs learned on a port.
  • show mac address-table vlan <id> — MACs in a VLAN.
  • show mac address-table count — table usage.
  • show mac address-table aging-time — aging timer.
  • show logging | include MACFLAP — MAC flapping messages.
ReferenceWhat it is1 section · depth on demand

What it is

An Ethernet switch learns source MAC addresses per VLAN and forwards, filters or floods frames according to destination lookup and port state.

ReferenceWhy it matters1 section · depth on demand

When to use it

Use it to trace a frame through VLAN membership, MAC learning, forwarding decisions and aging without confusing Layer-2 and Layer-3 state.

ReferenceHow it works2 sections · depth on demand

Operational mechanics and ownership

MAC Learning — A switch learns a source MAC from frames received on a forwarding port and associates it with the VLAN and ingress interface; destination MACs are looked up, not learned from transmitted frames. The CAM/MAC table is the immediate owner of learned location. Port security, EVPN/fabric control planes or static entries can alter normal learning semantics, so context matters.

MAC learning: observe one VLAN and source MAC

Scope: classic dynamic source-MAC learning on Cisco IOS / IOS XE Catalyst switching. Static/secure/sticky entries and control-plane-learned overlays require separate interpretation.

Start with show mac address-table address <mac> and show mac address-table dynamic vlan <vlan-id>. Read VLAN, MAC address, entry type and interface/port-channel together. The switch learns a source MAC from received frames in a VLAN; the same MAC can legitimately have entries in different VLANs. A DYNAMIC entry identifies a learned location, not a current endpoint-health guarantee.

clear mac address-table dynamic removes learned entries. It is a state-changing operation, not a read-only observation. Unknown-unicast forwarding can change while destinations are relearned, subject to the VLAN's forwarding and security policy. Preserve the original table and topology observations before considering a scoped clear.

References: Cisco MAC show commands, Cisco clear commands. Check spelling and qualifiers on the deployed platform.

ReferenceImportant terms & boundaries6 sections · depth on demand

Key operational limits

  • Source MAC is learned on ingress; destination MAC drives egress selection
  • Known unicast is forwarded to one learned port; unknown unicast and broadcast are flooded within the VLAN
  • A frame received on the learned destination port is filtered
  • Dynamic entries age; static entries remain until removed.

In depth

How MAC learning is programmed

A switch learns source MAC addresses from received frames, but on hardware platforms the learning path itself matters. Cisco's MATM technote for Catalyst 9000 describes it. A frame from a new source is punted to FED, which passes the information to IOS MATM and writes the same entry into the FED MATM hardware table. The two tables should always agree. When they don't, forwarding follows the hardware. In the technote's example, a stack member missing an entry in hardware broke traffic even though the software table looked right.

Entry types you will see

TypeCreated byNotes
DYNAMICLearning from received framesAges out when the host goes quiet
STATICConfiguration, or the switch's own SVI MACsDoesn't age; SVI MACs show as routed plus static (0x8002) in FED
SECURE / STICKYPort securityLimited count per port
Remote (EVPN/LISP)Control planeFED type 0x1000001 for EVPN-learned MACs

Checking learning end to end (technote)

CheckCommand
Is the MAC in software, on the right port and VLAN?show mac address-table address <mac>
Is it in hardware?show platform software fed switch active matm macTable vlan <id> mac <mac>
On every stack member?Repeat with switch <number>
Is the table full?TCAM utilisation; syslog MATM-3-MAX_ENTRIES
SW1# show mac address-table address a4bb.6d55.0164
 110    a4bb.6d55.0164    DYNAMIC     Gi1/0/14
SW1# show platform software fed switch 2 matm macTable vlan 110 mac a4bb.6d55.0164
SW1# show mac address-table notification mac-move
SW1(config)# mac address-table notification mac-move
SW1(config)# mac address-table static a4bb.6d55.0200 vlan 110 interface GigabitEthernet1/0/20
%SW_MATM-4-MACFLAP_NOTIF: Host a4bb.6d55.0164 in vlan 110 is flapping between port Gi1/0/14 and port Te1/1/1

When learning goes wrong

SymptomLikely cause
MAC flaps between two portsA loop, or a host connected twice (teaming misconfiguration)
Table fills quicklyA loop, a MAC flood attack, or too many hosts for the platform
MAC missing, but the host is sendingWrong VLAN, the port is blocking, or port security dropped the frame
Correct in software, wrong forwardingA hardware programming mismatch; check FED on every member

The technote's fixes are to remove the cause of excess learning, such as a loop, and to collect MATM traces for TAC if mis-programming persists.

Documented example, not captured output.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.

Quick reference

MAC learning is how a switch builds its MAC address table: for each incoming frame it records the source MAC with the receiving port and VLAN, refreshing the entry each time the address is seen again. Entries age out after 300 seconds of silence by default.

show mac address-table dynamic vlan 20
show mac address-table address 0011.2233.4455
show mac address-table count

Documented example, not captured output.

A MAC that keeps moving between ports ("MAC flapping" syslog messages) points to a loop or a device connected twice.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.

Mechanics and state ownership

A learning bridge examines the source MAC of a received Ethernet frame and associates it with the ingress port inside the relevant VLAN or bridge domain. Future frames destined to a known MAC can be forwarded only to the learned egress, while unknown-unicast frames are flooded to eligible forwarding ports. Dynamic entries age out after inactivity and are relearned on subsequent source traffic. A new frame for the same source on a different port updates/moves the entry; occasional movement can be legitimate in mobility designs, while rapid oscillation can indicate a loop, duplicate attachment or topology error. Port-channel, stacking, MLAG and overlay fabrics can abstract the physical location, so interpret the table’s logical egress in context.

State model and protocol mechanics

Ethernet learning is driven by source addresses, not destination addresses. When a frame arrives on a Layer-2 interface, the switch associates the source MAC address with the ingress port and VLAN in the forwarding database (FDB/CAM table). Future frames destined for that MAC can then be sent only toward the learned port instead of flooded. If the destination is unknown, the switch floods the frame to eligible ports in the same VLAN, excluding the ingress port and respecting STP state and other forwarding controls. Dynamic entries age out after inactivity, while a MAC move causes the learned location to change when frames from the same source arrive on a different port. Learning is VLAN-scoped: the same MAC may legitimately appear in different bridge domains, and an entry without its VLAN context is incomplete evidence. Hardware forwarding may be programmed from the logical FDB, so the operational chain is source frame → learned MAC/VLAN/port → destination lookup → forwarding or flood.

Limits and common misconceptions

A learned MAC address does not show the endpoint can receive frames, has a valid IP address or can reach an application. It only shows the switch observed that source on a particular Layer-2 attachment. Likewise, an absent entry does not automatically mean a cabling fault: the endpoint may be silent, the entry may have aged out, traffic may use another VLAN, or the path may be routed before reaching this switch. Unknown-unicast flooding is expected behavior when destination state is missing; it is not automatically a broadcast storm. A MAC move is also not inherently malicious or erroneous because virtual machines, redundant NICs and topology changes can move legitimate sources. Always preserve VLAN context and distinguish learning state, STP forwarding state, interface state and endpoint/application health.

ReferenceConfiguration & state1 section · depth on demand

Design and configuration model

MAC learning is normally automatic, so design work focuses on the Layer-2 boundaries that determine where learning is valid. Keep VLAN membership, trunks, EtherChannels and STP topology consistent so a source is observed on the expected logical interface. Static MAC entries should be used only where there is an explicit operational need because they suppress normal adaptation to movement. Features such as port security, EVPN control-plane learning, MAC address-table notifications or storm controls can alter or constrain ordinary learning behavior; document those exceptions rather than treating them as invisible implementation details. Avoid troubleshooting by clearing the table as a first action: clearing removes useful state and causes temporary unknown-unicast flooding. When you need a deterministic baseline, first capture the current MAC/VLAN/interface mapping and the age/type of the entry, then make the smallest necessary change.

Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Technical verification history

Verification history & basis

When and against what this Topic was checked. Later text edits do not count as a new check.

2026-09-14 · vendor docCisco IOS / IOS XE Current documentation reviewed 2026-09-14

Authoritative/upstream documentation reviewed for bounded claims in Switching → Ethernet Switching → MAC Learning. Documentation verification only; this is not observed lab or production Evidence.

Basis: https://www.cisco.com/c/en/us/support/ios-nx-os-software/ios-xe-17/series.html · confidence 94%
Embedded reference data

Quick lookup tables

MAC Learning · operational reference

Compact state and interpretation boundaries for fast lookup.

EvidenceWhat it provesWhat it does not prove
Dynamic MAC entrySource seen on VLAN/portEndpoint reachability
MAC age/typeFreshness and learning modePath stability
MAC moveSource location changedCause of the move
Unknown destinationNo current FDB matchLink or host failure

MAC Learning operational reference

Topic-specific bounded interpretation: known-good state, suspicious signatures and the next technical proof boundary.

MAC-table stateInterpretationSuspicious stateNext check
Dynamic expected portSource was learned thereCan be stale until agingGenerate source traffic
Port-channel egressLearned on logical bundleOne member may still failEtherChannel/member counters
Entry absentNo current learned locationTraffic may not reach/forwardIngress VLAN/STP/security
Rapid port movesSource seen on multiple pathsLoop, dual attach, mobility, spoofSTP/topology/move timestamps
Static/secure entryLocation constrained by config/securityMismatch can block legitimate movePort-security/static config
Confirmation

Confirm action

Continue?