Switched Campus
Switch Administration
Managing MAC address Table
MAC Address Table and VLANs
All MAC Addresses are associated with a VLAN and an address can exist in more than one VLAN.
Each VLAN maintains its own logical address table.
When private VLANs are configured, address learning depends on the type of MAC address:
- Dynamic MAC addresses learned in one VLAN of a private VLAN are replicated in the associated VLANs.
- Static MAC addresses configured in a primary or secondary VLAN are not replicated in the associated VLANs. When you configure a static MAC address in a private VLAN primary or secondary VLAN, you should also configure the same static MAC address in all associated VLANs.
Feature: | Default Settings: |
Aging Time | 300 seconds or 5 minutes |
Dynamic Address | Automatically Learned |
Static Address | None configured |
Commands:
mac address-table aging-time [ 0 | 10-1000000 ] [ vlan vlan-id ]
show mac address-table aging-time
Remove Dynamic MAC Address Entries
Remove Dynamic MAC Address Entries
clear mac address-table dynamic
clear mac address-table dynamic address mac-address
clear mac address-table dynamic interface interface-id
clear mac address-table dynamic vlan vlan-id
MAC Address Change Notification Traps
MAC address change notification tracks users on a network by storing the MAC address change activity.
When the switch learns or removes a MAC address, an SNMP notification trap can be sent.
Commands:
snmp-server enable traps mac-notification change
mac address-table notification change
mac address-table notification change [ interval value ] [ history-size value ]
Then, you configure per interface:
interface
GigabitEthernet0/1
snmp trap mac-notification change { added | removed }
Below shows how to specify 172.20.10.10 as the NMS, enable the switch to send MAC address notification traps to the NMS, enable the MAC address-change notification feature, set the interval time to 123 seconds, set the history-size to 100 entries, and enable traps whenever a MAC address is added on the specified port.
Switch(config)# snmp-server host 172.20.10.10 traps private mac-notification
Switch(config)# snmp-server enable traps mac-notification change
Switch(config)# mac address-table notification change
Switch(config)# mac address-table notification change interval 123
Switch(config)# mac address-table notification change history-size 100
Switch(config)# interface gigabitethernet1/0/2
Switch(config-if)# snmp trap mac-notification change added