Open In App

MAC Address Table On a Cisco Switches

Last Updated : 07 Jan, 2023
Improve
Improve
Like Article
Like
Save
Share
Report

The MAC (Media Access Control) address is a 48-bit physical identity of a device used to uniquely identify a device in layer 2 of the OSI model. It is represented in hexadecimal. The 3 bytes of the address represent the OUI, and the last 3 bytes are unique to the device itself. The switch keeps track of the other Ethernet interfaces on the network to which it is linked in the MAC address table. Instead of broadcasting the data over all ports, the table allows the switch to send outgoing data (Ethernet frames) on the exact port needed to reach its destination (flooding). Two different types of entries are possible in the MAC address table:

  • Static: The switch administrator must manually add static items to the table. Dynamic entries are less important than static entries. Static entries are active until the switch administrator deletes them.
  • Dynamic: Through a process known as MAC learning, in which the switch retrieves the source MAC address (and VLAN ID, if present) of each Ethernet packet received on a port, dynamic entries are automatically added to the table. If the table does not already include the obtained address, it is added. Dynamic entries are automatically erased after being present in the table for a certain period of time (specified by the command mac-address-table age-time).

The switch stores the MAC information in a table called the CAM table or the MAC table. CAM Table Stores:

  1. MAC address
  2. The interface
  3. VLAN MAC address belongs to
  4. How the MAC address is learned is statically or dynamically.

MAC address table for Cisco switches:

Consider a topology given below: Take 3 PC and connected them with a Cisco Switch and then connect the Switch to a router at the end such as given below:

 

Router0 configuration: Go to Router0 and do the following configuration.

interface GigabitEthernet0/0/0
ip address 192.168.1.1 255.255.255.0
no shutdown

PC0 configuration: Go to PC0 and do the following configuration.

 

PC1 configuration: Go to PC1 and do the following configuration.

 

PC2 configuration: Go to PC2 and do the following configuration.

 

PC3 configuration: Go to PC3 and do the following configuration.

 

Now, let’s make sure that the Switch has learned all the mac addresses by pinging devices with each other.

 

Check the Switches MAC table:

show mac address-table

 

VLAN Column represents the VLAN Mac address belongs to, MAC Address is the MAC address type is how the MAC address is learned and last sports represents the port MAC address is learned on.


Like Article
Suggest improvement
Share your thoughts in the comments

Similar Reads