Basic Switching Course 2
Basic Switching Course 2
Trunking
Native VLAN
Voice VLAN
2|Pa g e VOL: 1
There’s a switch in the middle and we have 3 computers. All computers have a MAC address
but I’ve simplified them. Our switch has a MAC address table and it will learn where all the MAC
addresses are in the network. Let’s send something from H1 to H2:
3|Pa g e VOL: 1
H1 is going to send some data meant for H2, thus it will create an Ethernet frame which has a
source MAC address (AAA) and a destination MAC address (BBB). Our switch has a MAC address
table and here’s what will happen:
4|Pa g e VOL: 1
Our switch will build a MAC address table and only learns from source MAC addresses. At this
moment it just learned that the MAC address of H1 is on interface 1. It will now add this
information in its MAC address table. As you can see our switch currently has no information
where H2 is located. There’s only one option left….flood this frame out of all its interfaces
except the one where it came from. H2 and H3 will receive this Ethernet frame.
5|Pa g e VOL: 1
Since H2 sees its MAC address as the destination of this Ethernet frame it knows it’s meant for
him, H3 will discard it. H2 is going to respond to H1, build an Ethernet frame and send it
towards our switch. At this moment the switch will learn the MAC address of H2.
That’s the end of our story, the switch now knows both MAC addresses and the next time it can
“switch” instead of flooding Ethernet frames. H3 will never see any frames between H1 and H2
except for the first one which was flooded.
Verification
Let me show you what this looks like on a real Cisco switch. I will use a topology with one switch
and three host devices:
6|Pa g e VOL: 1
This is the topology I’ll use, it’s the same as the previous example but I have added some
interface numbers.
All interfaces are connected, let’s check the MAC address table:
7|Pa g e VOL: 1
The show mac address-table dynamic command gives us all MAC addresses that the switch has
learned dynamically. We can see it has learned three MAC addresses.
There are a couple of parameters we can use with this command. For example:
This only gives us the output for the MAC address of H1. We can also get an overview of all
MAC addresses that were learned on a single interface:
8|Pa g e VOL: 1
If the switch doesn’t see a particular MAC address for 300 seconds, it will be removed from the
MAC address table.
What if we want to manually remove something from the MAC address table? This is possible
with the clear mac address-table command:
9|Pa g e VOL: 1
10 | P a g e VOL: 1
Take a look at the output of these two switches, especially their GigabitEthernet0/3 interfaces:
11 | P a g e VOL: 1
As you can see above, SW1 has learned the MAC addresses of H3 and H4 on its
GigabitEthernet0/3 interface. SW2 has learned the addresses of H1 and H2:
This is just a quick example to explain that a switch is able to learn multiple MAC addresses on a
single interface.
I hope this lesson has been useful to understand the MAC address table of your Cisco Catalyst
switch.
12 | P a g e VOL: 1