How to configure a maximum amount of allowed Static MAC addresses

Sets the max limit of static MAC addresses to 3. Range is <0-100> Default is 100.

Note: To clear dynamically learned MAC addresses from a port, you must perform the following example command.console#clear mac address-table dynamic interface gi1/0/5

Note: By default when port security violations occur, the port discards any frames on that interface originating from violating MAC addresses. The port is not shut down. If you are wanting the port to actually shut down you will need to add this command to the specific interfaces that require that feature: (config-if-Gi1/0/5)#switchport port-security violation shutdown :

How to configure the maximum limit of dynamically learned mac addresses on a specific interface

Command

Parameters

console#config

Enter configuration mode.

console(config)#interface gi1/0/5

Enter specific interface that needs port security.

console(config-if-gi1/0/5)#switchport port-security dynamic 0

This example uses 0 as you would normally want the port not to learn macs dynamically. Range is <0-600> Default is 100.