How does a switch learn MAC Addresses

thank you so much for the clear explanation!

1 Like

Hello Rene,

As I go through the Dynamic mac addresses learning concept, as per my understanding , Gi0/3 act as an uplink port to another switch, which i why it i learning all MAC address dynamically on the mentioned port. Could you clarify where we are using the dynamic method and where we are using the static method?

Hello Siva

Dynamic MAC address learning is the default behavior of switches. Whenever a frame comes into a port, it will read the source MAC address of that frame, and place it within the MAC address table, and correspond it with the incoming interface. This is done regardless of whether or not you have an uplink to a switch or a connection to an end device.

Static entries in the MAC address table, unlike the dynamic ones, are configured manually by inputting the specific MAC address and the corresponding port. This is not done very often as there are very few use cases for this. Take a look at this NetworkLessons note about static MAC address table entries.

I hope this has been helpful!

Laz

Hi Laz,
Thanks for the explanation.

1 Like

Hi,

May I know, I can able to learn the ip address of the down cisco switch from the core device and it given the mac address of the switch , when I use show ip arp xxxx (ip address of the switch) but when I try with learned mac address to identify the respective port status from core switch, I didn’t get any output? here I need to understand why it is not giving the result which interface it get connected ? I also wanted to understand , MAC Address is layer 2 (Data link) and IP Address layer 3 (Network ) , even though I can see the ip address but why not that specific mac address, where it get connected?

Hello Siva

The ARP table is used to map a network layer (Layer 3) address (like an IP address) to a data link layer (Layer 2) address (like a MAC address). So when you use the ‘show ip arp’ command, you’re asking the device to show you this mapping.

So from the core switch, you were able to find the MAC of the downed switch. Now note here, this is the MAC address of the switch used for communication of the switch itself. It does not give you any port information.

Now, when you’re trying to find the interface or the port that a specific MAC address is connected to, you should be using the show mac address-table command. This command provides a table that maps MAC addresses to their associated ports. If you’re not getting any output, it could be because the MAC address you’re searching for isn’t currently in the table.

As for your question about why you can see the IP address but not the MAC address, it’s because the two operate at different layers of the OSI model. The IP address operates at Layer 3 (the Network Layer), which is concerned with routing packets across networks. The MAC address, on the other hand, operates at Layer 2 (the Data Link Layer), which is concerned with the transfer of data between network entities in the same network.

In other words, when a packet travels across the network, it’s the IP address that gets it to the right network. Once it’s in the right network, it’s the MAC address that gets it to the right device.

I hope this has been helpful!

Laz