How to avoid flooding in Layer 2 Address learning?
... Re: How to avoid flooding in Layer 2 Address learning?
When you change the ports then the switch needs to re-learn the MAC to interface mapping, this is expected behavior since you changed the ports they are plugged into. Use the "show mac-address-table" command to see this mapping.
A switch learns the MAC addresses by looking at the source MAC address of a frame going out of the interface. When you ping host B from host A the swtich learns the MAC of host A because a frame left port 3. But the switch does not know the location of the destination MAC address, so it floods the ports. When host B gets one of the flooded frames it sees that it's a frame destined for them and when it responds to host A out of port 4 the switch learns the MAC of host B. Now the switch knows both MAC addresses.
[
https://learningnetwork.cisco.com/thread/25001]