December 8, 2024
Switch MAC Address Table

A switch keeps up an powerfully built address table utilizing the source MAC addresses of gotten outlines. The switch takes the gotten outline and it’s approaching MAC address table of the sending gadget with the LAN harbour it was gotten on and puts that within the address table.

If the switch gets a outline and sees that the goal MAC address isn’t recorded within the address table it’ll surge that outline to all LAN ports of the same VLAN. When the goal answers, the switch includes that source MAC address to the table.

MAC passages are held on switch reboot. To preserve a clean table, an maturing clock is utilized to expel dormant MAC addresses from the table. This maturing clock is arranged in seconds.

Aside from dynamically learning MAC addresses, you’ll be able moreover design Inactive MAC addresses. The language structure for designing a inactive MAC address is:

SW1(config)#mac address-table static mac_address vlan vlan-id {drop | interface {type slot/port} | port-channel number} [auto-learn]

SW1#conf t
SW1(config)#mac address-table static aaaa.bbbb.cccc vlan 10 interface gigabitethernet 1/0/4

To delete a static MAC address add the no keyword in front of the command above.

Aging Timer

Configure the aging timer for all MAC addresses on the switch:

SW1#conf t
SW1(config)#mac address-table aging-time seconds [vlan vlan-id]

The time range is from 10 – 1000000. Configuring an aging time of 0 disables aging.

Clear Dynamic Addresses

This command clears all dynamic MAC entries from the MAC address table:

SW1#clear mac address-table dynamic

You can be more granular with clearing addresses. Here is the syntax:

SW1#clear mac address-table dynamic {address mac_address} {interface [type slot/port | port-channel number} {vlan vlan_id}

Verify the MAC Address

Use these show commands:

show mac address-table to display the contents of the MAC addresses.

SW1#show mac address-table
 Mac Addres-table
-------------------------------------------
Vlan Mac Address Type Ports
---- ----------- -------- -----
 All 000d.bdd3.4e80 STATIC CPU
 All 000d.bdd3.4e81 STATIC CPU
 All 000d.bdd3.4e82 STATIC CPU
 10 0090.7f9b.0a35 DYNAMIC Po10
 10 0090.7f9b.0a36 DYNAMIC Po10
Total Mac Addresses for this criterion: 5

 

 

About Author