Switching Tables (Part-4)

Managing the CAM Table

Each entry in the CAM table contains the following information:


• The MAC address
• The switch port the MAC address was learned on
• The VLAN of the switch port
• A time stamp, for the aging timer

To view the entire CAM table:

Switch# show mac address-table
vlan mac address type port
-------+---------------+---------+---------------------
9 000c.291e.96f0 dynamic GigabitEthernet1/1
9 000c.293c.7cac dynamic GigabitEthernet1/1
9 000c.2950.e3e9 dynamic GigabitEthernet1/1
9 000c.29ba.fe28 dynamic GigabitEthernet1/2
9 842b.2ba6.3a7d dynamic GigabitEthernet1/3
9 d067.e50b.1975 dynamic GigabitEthernet1/5
9 d067.e51e.e35a dynamic GigabitEthernet2/1
9 f04d.a2f6.d37b dynamic GigabitEthernet2/2

A single switch port can learn many addresses. In the above output, GigabitEthernet1/1 has multiple MAC addresses associated with it. This usually indicates this is an uplink to another switch.


To view the CAM table entries for a specific port or MAC address: 


Switch# show mac address-table interface GigabitEthernet 1/5
vlan mac address type port
-------+---------------+---------+---------------------
9 d067.e50b.1975 dynamic GigabitEthernet1/5


Switch# show mac address-table address f04d.a2f6.d37b
vlan mac address type port
-------+---------------+---------+---------------------
9 f04d.a2f6.d37b dynamic GigabitEthernet2/2

The output of a command can be filtered using the pipe command. For example, to search for any entry that contains 3a7d in the MAC address:

Switch# show mac address-table | include 3a7d
 vlan mac address type port
-------+---------------+---------+---------------------
 9 842b.2ba6.3a7d dynamic GigabitEthernet1/3

To specifically display only dynamic or static CAM entries:

Switch# show mac address-table dynamic
Switch# show mac address-table static


To view the total number of entries in the CAM table:

Switch# show mac address-table count

MAC Entries for all vlans:
Dynamic Unicast Address Count:                                     234
Static Unicast Address (User-defined) Count:                   0
Static Unicast Address (System-defined) Count:               6
Total Unicast MAC Addresses In Use:                             240
Total Unicast MAC Addresses Available:                         55000
Multicast MAC Address Count:                                       9
Total Multicast MAC Addresses Available:                       32768

The CAM aging timer can be changed from its default of 300, though this is needed only in rare circumstances:

Switch# config t
Switch(config)# mac address-table aging-time 360

To add a static entry into the CAM table:

Switch(config)# mac address-table static 0011.2233.4455 vlan 9 interface GigabitEthernet 2/7

To clear all dynamic entries in the CAM table:

Switch# clear mac address-table dynamic all

To clear a single entry in the CAM, either by MAC address or interface:

Switch# clear mac address-table dynamic address d067.e51e.e35a
Switch# clear mac address-table dynamic interface GigabitEthernet 2/1

Note: In Cisco IOS versions prior to 12.1, the syntax for all CAM table commands contained an additional hyphen between mac and address:

Switch# show mac-address-table

This additional hyphen is no longer required on modern versions of the IOS. Some IOS versions may support both syntaxes.

Comments

Popular posts from this blog

Disabling Zimbra's AntiSpam, Amavis and AntiVirus filtering

Cambium cnPilot E400/E410/E500 Configuration Tutorial

Error "Unable to retrive Zimbra GPG key for package validation"