Managing MAC address table in Cisco is the most basic but important skill. In this lesson we will discuss in details about it.

A Switch manage and use a mac address table to forward traffic from one interface to another. This address table is a combination of Vlan ID, MAC Address, Address Type and Associated Port number.

Managing MAC address table in Cisco

MAC address table are two types. These are dynamic address and static address. Dynamic address is the address that switch learns dynamically. Static address is the address that manually put by the administrator. The main difference between these two types is static address will not be removed if switch rebooted and there is no aging time for static mac.

To manage mac address table, we need to know a couple of commands in Cisco Catalyst switches. First of all checking the mac address table by using “show mac address-table“.

Cisco-SW#show mac address-table
          Mac Address Table
-------------------------------------------

Vlan    Mac Address       Type        Ports
----    -----------       --------    -----
   1    0050.7966.6800    DYNAMIC     Gi0/0
   1    0050.7966.6802    DYNAMIC     Gi0/1
   1    0050.7966.6803    DYNAMIC     Gi0/1
   1    0050.7966.6804    DYNAMIC     Gi0/2

If you know the specific mac address, then you can use below command to check mac address entry for that address using “show mac address-table address xxxx.xxxx.xxxx“.

Cisco-SW#show mac address-table address 0050.7966.6800
          Mac Address Table
-------------------------------------------

Vlan    Mac Address       Type        Ports
----    -----------       --------    -----
   1    0050.7966.6800    DYNAMIC     Gi0/0
Total Mac Addresses for this criterion: 1

If you want to check mac address for a particular port number, then you can use “show mac address-table interface {interface-number}” command.

Cisco-SW#show mac address-table interface gig0/0
          Mac Address Table
-------------------------------------------

Vlan    Mac Address       Type        Ports
----    -----------       --------    -----
   1    0050.7966.6800    DYNAMIC     Gi0/0
   1    0050.7966.6801    DYNAMIC     Gi0/0
   1    0cea.e70d.8001    DYNAMIC     Gi0/0
   1    0cea.e70d.9a00    DYNAMIC     Gi0/0
Total Mac Addresses for this criterion: 4

You also can check mac address table based on vlan id using “show mac address-table vlan {vlan-id}

Cisco-SW#show mac address-table vlan 1
          Mac Address Table
-------------------------------------------

Vlan    Mac Address       Type        Ports
----    -----------       --------    -----
   1    0cea.e70d.9a00    DYNAMIC     Gi0/0
   1    0cea.e765.1102    DYNAMIC     Gi0/2
   1    0cea.e7a6.be01    DYNAMIC     Gi0/1
   1    0cea.e7b9.e103    DYNAMIC     Gi0/3
Total Mac Addresses for this criterion: 4

There is another important thing you need to know to manage mac address table, which is aging time. Default aging time is 300 ms. You can check using “show mac address-table aging-time” command and change it as per your requirement. To change, use below command-

Cisco-SW(config)#mac address-table aging-time ?
  <0-0>         Enter 0 to disable aging
  <10-1000000>  Aging time in seconds

Cisco-SW(config)#mac address-table aging-time 500 ?
  routed-mac  Set RM Aging interval
  vlan        VLAN Keyword
  cr

If you want to configure static MAC address on a Cisco switch, then below are the command.

Cisco-SW(config)#mac-address-table static {mac-id} interface {interface-number} vlan {vlan-id}

We also can stop leaning mac addresses from a particular interface or vlan. There is a guideline to do so, please read CISCO Guideline carefully before doing this.

Cisco-SW(config)# no mac address-table learning vlan 200

Written by Rajib Kumer Das

I am Rajib Kumer Das, a network engineer with 7+ years of experience in multi-vendor environment. In my current company, I am responsible to take care critical projects and it's support cases. I do have several vendor certificates and have plans to go further.

Leave a Comment

Your email address will not be published. Required fields are marked *