It is a security violation when either of these situations occurs:

An interface can be configured for one of three violation modes, specifying the action to be taken if a violation occurs. The figure presents which kinds of data traffic are forwarded when one of the following security violation modes are configured on a port:

To change the violation mode on a switch port, use the switchport port-security violation {protect | restrict |shutdown} interface configuration mode command.