Menu
Coddy logo textTech

The Switch Learns Too

Lesson 8 of 35 in Coddy's LAN Labs course.

A switch does not know addresses when it is switched on. It learns: every frame that arrives on a port teaches the switch "this MAC lives behind this port". The result is its MAC table, and it is what lets a switch deliver a frame to exactly one port instead of flooding every port like an old hub.

netlab show mac SWITCH displays the table. Empty before traffic; after a ping between two hosts it holds both MACs, each mapped to the port the host is plugged into.

challenge icon

Challenge

Beginner

Ping pc2 from pc1, then show sw1's MAC table.

Expected output:

pc1 -> pc2: reply from 192.168.1.20 (ttl=64)
PORT   MAC                LEARNED-FROM
port1  02:c0:dd:aa:ec:b3  pc1
port2  02:c0:dd:a0:9f:64  pc2

Try it yourself

Terminal

All lessons in LAN Labs

Practice on your own: Terminal playground