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
BeginnerPing 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 pc2Try it yourself
All lessons in LAN Labs
2Addresses on the LAN
Giving a Host an AddressThe First PingWhat ARP LearnedThe Switch Learns TooRecap - First Conversation8Capstone - Fix the Branch
Survey the DamageFix the Address ClashMasks and GatewaysRecap - Prove It WorksPractice on your own: Terminal playground