Use it when frames are flooded or MAC addresses move between ports.
MAC learning · Layer 2 Switch
A switch learns MAC addresses by recording the source MAC and ingress port (per VLAN) of each frame in its MAC address table; unknown destinations are flooded and entries age out (300 s by default).
1. L2 switches learn source MACs per VLAN and port.
2. Aging 300 s.
3. Flooding unknowns.
4. MAC flapping indicates loops.
5. Limit with port security.
frame → learn source MAC → table
Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
Verification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 MAC table problems Narrow the fault
- MAC flapping between ports (loop or misconfigured server NIC teaming).
- Table full after a flooding attack → unicast flooding.
- Very short aging on busy networks causes unnecessary flooding.
- MAC learned on the uplink instead of the access port → host is behind another switch.
Evidence · 1 on this Topic
Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.
- Switches learn MAC addresses from the source address of incoming frames.
- Entries age out after 300 seconds by default.
show mac address-tableshows learned entries.
show mac address-table dynamic— learned MACsshow mac address-table count— usage
ReferenceWhat it is1 section · depth on demand
How it works
A switch learns the source MAC of every frame and records it with the VLAN and ingress port. Frames to a known MAC go only to that port; unknown, broadcast and multicast frames are flooded in the VLAN. Entries age out after 300 seconds of silence by default.
ReferenceWhy it matters1 section · depth on demand
Commands and limits
show mac address-table dynamic vlan 10
show mac address-table address 0050.56aa.0001
show mac address-table count
mac address-table aging-time 300
The table has a finite size (platform-dependent, often 16k–64k entries). If it fills (MAC flooding attack or very large L2 domain), new addresses are flooded like unknown unicast. Port security limits MACs per port.
ReferenceImportant terms & boundaries1 section · depth on demand
In depth
How the table behaves over time
| Event | Table action |
|---|---|
| Frame arrives with new source MAC | Entry created: VLAN + MAC → ingress port, type DYNAMIC |
| Same MAC seen again on same port | Age timer reset |
| Same MAC seen on another port | Entry moves (MAC move); frequent moves are logged as flapping |
| No frame from MAC for aging time (300 s default) | Entry removed |
| Topology change (STP TCN) | Aging shortened to forward delay (15 s) for that VLAN |
Switch# show mac address-table count vlan 10
Dynamic Address Count : 412
Static Address Count : 2
Total Mac Addresses : 414
Switch# show mac address-table aging-time
MAC flapping
%SW_MATM-4-MACFLAP_NOTIF: Host 0050.56aa.0001 in vlan 10 is flapping between port Gi1/0/1 and port Gi1/0/2
Causes: a Layer 2 loop, NIC teaming in a mode the switch does not expect, a virtual switch bridging two uplinks, or a moving wireless client. A loop is the dangerous one — check show spanning-tree vlan 10 detail | include changes|from for frequent topology changes.
Unknown unicast flooding from asymmetric paths
The default ARP timeout on IOS is 4 hours, but MAC aging is 5 minutes. If return traffic takes another path, a router can keep a valid ARP entry while the switch has aged out the MAC — every frame is then flooded in the VLAN. Fix by aligning the timers (mac address-table aging-time 14400 or a shorter arp timeout) or by making routing symmetric.
Catalyst 9000 hardware check
When a host is in show mac address-table but traffic floods or drops, compare the software table with the hardware MATM programming (show platform software fed switch active matm macTable vlan 10) as described in Cisco's MATM troubleshooting guide.
Documented example, not captured output.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in Network Devices → Layer 2 Switch → 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%