Configuring MAC Address Notification

MAC Address Notification

This feature enables the user or administrator to keep track of the MAC addresses that are learned or removed on the Layer 2 switch while forwarding the Ethernet frames. This feature is required to keep a history of the MAC addresses that are learned and deleted from the router and generate notifications to the NMS periodically.

Whenever a new MAC address is learned or an old MAC address is removed, a SNMP notification is generated and sent to the NMS. A history table is also maintained for every hardware port, so that NMS can collect information by querying the MIB for the history table. This is done to make sure even when the notifications are not delivered to the NMS properly; the data is preserved on the router for the NMS to collect.


Note


This feature will generate MAC notifications only for dynamic addresses. No notifications are generated for self, static, or multicast addresses.


Configuring MAC Address Notification

Follow these steps to configure MAC address notification:

Procedure

  Command or Action Purpose

Step 1

configure terminal

Example:

Router# configure terminal

Enter global configuration mode.

Step 2

[no ] mac-address-table notification change mac-move [interval value ] | [historysize value ] | mac-move

Enable MAC notification feature. It is disabled by default.

  • interval value —Sets the notification trap interval in seconds. The switch will dispatch the notification trap only after this value is elapsed. Default is 1 second.

    historysize value —Configures the maximum number of entries in the MAC notification history table. The old table will be deleted and a new table will be created when this command is issued. Default size is 1.

    mac-move —Enables MAC move notification.

Step 3

interface interface-id

Example:

Router(config)# interface gigabitethernet 0/1/1

Enters interface configuration mode, and specifies the Layer 2 interface on which to enable the SNMP MAC address notification trap.

Step 4

[no ] snmp trap mac-notification {added | removed }

Example:

Router(config-if)# snmp trap mac-notification change added

After MAC notification is enabled globally, use this command to enable/disable MAC notification traps on a particular port. By default it is disabled.

  • added —Enables MAC notification trap when an address is added on this port.

  • removed —Enables MAC notification trap when an address is removed from this port.

Step 5

end

Example:

Router(config)# end

Returns to privileged EXEC mode.

Step 6

[no ] snmp-server enable traps mac-notification

The actual notification traps will be sent only after this command is entered even if MAC notification is enabled globally and at the port. It is disabled by default.

Step 7

show mac-address-table notification [interface interface-id ]

Verify if the feature is enabled or disabled, and display MAC notification interval and the history table.