The MAC Address Count feature provides a way to notify the switch management system when the number of MAC addresses learned on a switch port exceeds the permitted configurable number.
To enable the mac-count-notify option, enter this command in global config context.
Syntax
Sends a trap when the number of MAC addresses learned on the specified ports exceeds the configured
<learned-count>
value.
To configure the mac-count-notify option on a port or ports, enter this command. When the configured number of MAC addresses is exceeded (the learned-count), a trap is sent.
Syntax
Configures mac-count-notify traps
on the specified ports (or all) for the entire switch.
The [no]
form of the command disables mac-count-notify traps
.
[<learned-count>]
: The number of MAC addresses learned before sending a trap. Values range between 1-128.
Example configuring mac-count notify traps on ports 5–7
HP Switch (config#) mac-count-notify traps 5-7 50
When enabled, this feature allows the generation of SNMP traps for each MAC address table change. Notifications can be generated for each device that connects to a port and for devices that are connected through another device (daisy-chained.)
The snmp-server enable traps mac-notify
command globally enables the generation of SNMP trap notifications upon MAC address table changes.
Syntax
Globally enables or disables generation of SNMP trap notifications.
trap-interval The time interval (in seconds) that trap notifications are sent. A value of zero disables the interval and traps are sent as events occur. If the switch is busy, notifications can be sent prior to the configured interval. Notifications may be dropped in extreme instances and a system warning is logged.The range is 0-120 seconds. Default: 30 seconds. mac-move Configures the switch to capture data for MAC addresses that are moved from one port to another port. The snmp-server enable traps mac-notify
command must have been enabled in order for this information to be sent as an SNMP notification.Example of trap-interval option
HP Switch (config#) snmp-server enable traps mac-notify trap-interval 60Example of mac-move option
HP Switch (config#) snmp-server enable traps mac-notify mac-move
You can also execute the mac-notify traps
command from the interface context.
Example of the interface context for MAC-notify traps command
(HP_Switch_name#) int 11 HP Switch(int-11)# mac-notify traps learned
Use the following command to configure SNMP traps for learned or removed MAC addresses on a per-port basis.
|
|
NOTE: The switch will capture learned or removed events on the selected ports, but will not send an SNMP trap unless mac-notify has been enabled with the |
|
|
Syntax
When this command is executed without the learned or removed option, it enables or disables the capture of both learned and removed MAC address table changes for the selected ports in<PORT-LIST>
.
<PORT-LIST> |
Configures MAC address table changes capture on the specified ports. Use all to capture changes for all ports on the switch. |
learned | Enables the capture of learned MAC address table changes on the selected ports. |
removed | Enables the capture of removed MAC address table changes table on the selected ports. |
Example of configuring traps on a per-port basis for learned MAC addresses
(HP_Switch_name#) mac-notify traps 5-6 learned (HP_Switch_name#) show mac-notify traps 5-6 Mac Notify Trap Information Mac-notify Enabled : Yes Mac-move Enabled : Yes Trap-interval : 60 Port MAC Addresses trap learned/removed ------ ---------------------------------- 5 Learned 6 Learned
Example of configuring traps on a port-bases for removed MAC addresses
(HP_Switch_name#) mac-notify traps 3-4 removed HP_Switch(config#) show mac-notify traps Mac Notify Trap Information Mac-notify Enabled : Yes Mac-move Enabled : Yes Trap-interval : 60 Port MAC Addresses trap learned/removed ------ ---------------------------------- 1 None 2 None 3 Removed 4 Removed
Use the show mac-count-notify traps [<PORT-LIST>] command to display information about the configured value for sending a trap, the current count, and if a trap has been sent.
Example of information displayed for show mac-count-notify traps
command
HP Siwtch (config #) show mac-count-notify traps Mac-count-notify Enabled: Yes Port Count for Count Trap Sent sending Trap ----------------------------------------------------------------- 1 2 3 4 5 50 0 No 6 50 2 No 7 50 0 No 8 9 ...
The interface context can be used to configure the value for sending a trap.
Example of configuring mac-count-notify traps from the interface context
HP Switch (config#) interface 5
HP Switch (eth-5)# mac-count-notify traps 35
The show snmp-server traps
command displays whether the MAC Address Count feature is enabled or disabled.
Example of information about SNMP traps, including MAC address count being Enabled/Disabled
(HP_Switch_name#) show snmp-server traps Trap Receivers Link-Change Traps Enabled on Ports [All] : All Traps Category Current Status _____________________________ __________________ SNMP Authentication : Extended Password change : Enabled Login failures : Enabled Port-Security : Enabled Authorization Server Contact : Enabled DHCP-Snooping : Enabled Dynamic ARP Protection : Enabled Dynamic IP Lockdown : Enabled MAC address table changes : Disabled MAC Address Count : Enabled Address Community Events Type Retry Timeout ---------------------- ---------------------- -------- ------ ------- ------- 15.146.194.77 public None trap 3 15 15.255.134.252 public None trap 3 15 16.181.49.167 public None trap 3 15 16.181.51.14 public None trap 3 15 Excluded MIBs
Use the show mac-notify traps
command to display information about SNMP trap configuration for MAC Address Table changes.
Syntax
Example of information for SNMP trap configuration
Displays SNMP trap information for all ports, or each port in the
<PORT-LIST>
.(HP_Switch_name#) show mac-notify traps Mac Notify Trap Information Mac-notify Enabled : Yes Mac-move Enabled : Yes Trap-interval : 60 Port MAC Addresses trap learned/removed ------ ---------------------------------- 1 None 2 None 3 Removed 4 Removed 5 Learned 6 Learned
The configured mac-notify
commands are displayed in the show running-configuration
output.
Example of running config file with mac-notify parameters configured
(HP_Switch_name#) show running-config Running configuration: ; J9087A Configuration Editor; Created on release #R.11.XX hostname "Switch" snmp-server community "public" Unrestricted snmp-server host 15.255.133.236 "public" snmp-server host 15.255.133.222 "public" snmp-server host 15.255.133.70 "public" snmp-server host 15.255.134.235 "public" vlan 1 name "DEFAULT_VLAN" untagged 1-28 ip address dhcp-bootp exit snmp-server enable traps mac-notify mac-move snmp-server enable traps mac-notify trap-interval 60 snmp-server enable traps mac-notify mac-notify traps 5-6 learned mac-notify traps 3-4 removed