MAC Address Table
A switch is not configured with a map of which device sits on which port. It builds that map itself, frame by frame, by watching source MAC addresses. This lesson explains where that map lives, how it is learned, how it is used to forward, and how entries age out.
- Describe where the MAC address table lives and what it stores.
- Explain how a switch learns from the source MAC of incoming frames.
- Explain how a switch forwards: known unicast, unknown unicast (flood), broadcast/multicast.
- State the default aging time and the difference between dynamic, static, and secure entries.
- Read a real show mac address-table output.
- Configure a static MAC entry with IOS.
Where the table lives
A Layer-2 switch forwards frames using a table of MAC addresses and the ports they are reachable through. Cisco calls this structure the MAC address table; it is also known as the CAM table, for Content-Addressable Memory, the specialised memory inside the switch that makes these lookups extremely fast. Unlike a normal list that you search from the top, CAM is exact-match memory: the switch hands it a MAC address and CAM returns the matching entry in a single, near-instant operation. That is what allows a switch to forward millions of frames per second in hardware.
What the table stores
A typical entry has four pieces of information:
| Column | Meaning |
|---|---|
| VLAN | The VLAN in which the MAC was seen (default VLAN 1). |
| MAC address | The 48-bit address, shown in Cisco dotted notation. |
| Type | How the entry got there: DYNAMIC (learned), STATIC (manually added), or SECURE (added by port security). |
| Port / Age | The port the address is reachable through; many displays also show an age timer for dynamic entries. |
How the switch learns
Switches start with an empty table and learn by watching traffic. For every frame that arrives on a port, the switch reads the frame’s source MAC address and records a mapping: that source MAC is reachable out of the port the frame came in on (the ingress port). If the address is not already known, the switch adds a new dynamic entry. If it is known but the port has changed — because the device moved — the switch updates the entry to point to the new port.
Learning is automatic and needs no configuration. A device announces itself to the switch simply by sending any frame at all. The switch does not care what protocol is inside; it only reads the Layer-2 header.
How the switch forwards
Once it has read the addresses, the switch looks up the destination MAC in the table and acts on what it finds:
- Known unicast. If the destination MAC is in the table, the switch forwards the frame out of only that one port. This is the efficient normal case.
- Unknown unicast. If the destination MAC is not in the table, the switch does not know where to send it, so it floods: it copies the frame out of every port except the port it arrived on. The correct host will receive it; the others simply discard it.
- Same port (filter). If the destination is on the same port the frame arrived on, the switch drops the frame — there is no reason to send it back out the way it came. This is called filtering.
Broadcast and multicast
Frames whose destination is a group address cannot be sent to “the one port” because they are meant for more than one recipient:
- Broadcast (
FF:FF:FF:FF:FF:FF) is flooded out of every port except the ingress port. - Multicast is also flooded by a plain Layer-2 switch, which does not track who joined which group. With IGMP snooping (or the older Cisco CGMP), the switch can listen to the group membership and forward multicast only out the ports that actually want it — but this is an optimisation, not the default.
So the default rule for a switch is simple: known unicast goes to one port; everything else (unknown unicast, broadcast, multicast) is flooded to all other ports.
Aging, dynamic, static, and secure
Because devices move and addresses change, learned entries do not live forever. Each dynamic entry has an age timer. Every time the switch sees a frame from that source MAC, the timer resets. If the timer expires, the entry is removed and the switch must learn the address again the next time it appears. On Cisco switches the default aging time is 300 seconds (5 minutes).
| Type | How it is created | Ages out? |
|---|---|---|
| Dynamic | Learned automatically from a source MAC; the default. | Yes — after the aging time (default 300 s) of inactivity. |
| Static | Configured by an administrator for a specific port. | No — it stays until you remove it. |
| Secure | Created by port security when a permitted MAC is seen. | Persists for the port; treated like a static entry while it is allowed. |
You normally let the switch learn everything automatically. A static entry is useful when you want to pin a known device — say a server or a printer — to a fixed port, or when port security must restrict which MAC addresses may use a port.
Switch(config)# mac address-table static 0026.5a1b.3f00 vlan 10 interface gigabitethernet0/24
Switch(config)# mac address-table aging-time 300
Switch(config)# end
mac address-table static mac-addr vlan vlan-id interface
interface-id binds a MAC address to a specific port permanently. The
aging-time command changes how long dynamic entries survive; the default is 300 seconds.
Reading the table in IOS
The command to view the table is show mac address-table. Here is realistic output from a small access switch:
Switch# show mac address-table
Mac Address Table
-------------------------------------------
Vlan Mac Address Type Ports
---- ----------- -------- -----
1 0001.9715.6a02 DYNAMIC Gi0/1
1 0001.9715.6a03 DYNAMIC Gi0/2
10 0050.0f2a.9c11 DYNAMIC Gi0/10
10 0050.0f2a.9c12 DYNAMIC Gi0/11
10 0026.5a1b.3f00 STATIC Gi0/24
10 00d0.ba76.5c4a SECURE Gi0/12
Total Mac Addresses for this criterion: 6
Switch# show mac address-table dynamic
Switch# show mac address-table address 0050.0f2a.9c11
Switch# clear mac address-table dynamic
A few practical notes on that output:
- Each row tells you the VLAN, the MAC, the type, and the port. Read the last column first: it is the answer to “where does this address live?”.
DYNAMICrows were learned automatically;STATICandSECURErows were not.- You can filter with keywords such as
dynamic,static,address mac,vlan id, orinterface port. clear mac address-table dynamicwipes all learned entries — handy for troubleshooting, because the switch immediately relearns from live traffic.
A worked timeline
Watch how a table fills at boot, and how a static entry behaves differently. The switch has just powered on, so its dynamic table is empty, but an administrator has already saved one static entry: the server on Gi0/24.
| Time | Event | Table after the event | Action taken |
|---|---|---|---|
| t0 | Switch boots | Static: server → Gi0/24 only | — |
| t1 | PC 1 sends a frame to PC 2 | + PC 1 → Gi0/1 | Learns PC 1 from SA; PC 2 unknown, so it floods |
| t2 | PC 2 replies to PC 1 | + PC 2 → Gi0/2 | Learns PC 2 from SA; PC 1 is now known, so it forwards to Gi0/1 only |
| t3 | PC 3 sends a broadcast | + PC 3 → Gi0/3 | Learns PC 3; broadcast is flooded to all other ports |
| t4 | 300 s pass with no traffic from PC 3 | PC 3 entry removed | Dynamic entry ages out; the static server entry remains |
| t5 | A frame arrives for PC 3 | unchanged | PC 3 is unknown again, so the switch floods until PC 3 speaks |
Two lessons fall out of that timeline. First, the switch only ever knows an address after it has heard from that address — a silent device is unknown. Second, the static entry never ages, so the server stays pinned to Gi0/24 the whole time. This is exactly why a stale dynamic entry (from a device that moved) is refreshed automatically: the new port’s traffic overwrites the old mapping.
The vocabulary you need
Every term below appears in the lesson text above. Select one to read its definition, then use the quiz at the end to check what stuck.
Review
Check what you have learned with these review questions.
Sources & references
- Cisco. CCNA (200-301) Exam Topics. cisco.com.
- IETF. Request for Comments (RFCs). rfc-editor.org.
- IANA. Internet Assigned Numbers Authority registries. iana.org.
Target exams: CCNA 200-301 v1.1 · CyberOps Associate 200-201. Last content verification: 2026-10-11.