Hone

Lessons · Network switches · the MAC address table

What the switch has learned

The MAC address table maps each address the switch has heard to the port it was heard on, and it is built entirely from traffic that has already arrived.

Hone is a place to practise programming. This is one of its lessons, written out in full and free to read without an account.

What it is for

It is how you find where a device physically is. Given one address, this table tells you which port to walk to, which no diagram will do reliably.

How to think about it

Read it as evidence, not configuration. An address in the table means that device really sent something through that port; an empty table means nothing has been heard yet.

Worked example

enable
The # prompt.
show mac address-table
Vlan, address, type and port. On a switch with nothing plugged in, the total is zero, which is honest rather than broken.
show interfaces status
Which ports are connected. A connected port with no addresses against it means the device on it has not spoken yet.
show vlan brief
And which VLAN each of those ports is in, because the table is per VLAN as well as per port.

Your turn

Show what the switch has learned about who is where.

show mac 

The trap

Expecting to find a device that has been silent. The table is learned from traffic, so a machine that is on but idle may not be in it at all.

Practise the MAC address table on HoneA question on it now, a coding challenge where there is one, and it is remembered for review. Free, no email needed.