
21-12
Catalyst 3550 Multilayer Switch Software Configuration Guide
78-11194-09
Chapter 21 Configuring Port-Based Traffic Control
Configuring Port Security
Step 6
switchport port-security violation
{protect | restrict | shutdown}
(Optional) Set the violation mode, the action to be taken when a security
violation is detected, as one of these:
•
protect—When the number of secure MAC addresses reaches the
limit allowed on the port, packets with unknown source addresses
are dropped until you remove a sufficient number of secure MAC
addresses or increase the number of maximum allowable addresses.
You are not notified that a security violation has occurred.
Note
We do not recommend enabling the protect mode on a trunk
port. The protect mode disables learning when any VLAN
reaches its maximum limit, even if the port has not reached its
maximum limit.
•
restrict—When the number of secure MAC addresses reaches the
limit allowed on the port, packets with unknown source addresses
are dropped until you remove a sufficient number of secure MAC
addresses or increase the number of maximum allowable addresses.
In this mode, you are notified that a security violation has occurred.
Specifically, an SNMP trap is sent, a syslog message is logged, and
the violation counter increments.
•
shutdown—In this mode, a port security violation causes the
interface to immediately become error-disabled, and turns off the
port LED. It also sends an SNMP trap, logs a syslog message, and
increments the violation counter.
Note
When a secure port is in the error-disabled state, you can bring
it out of this state by entering the errdisable recovery cause
psecure-violation global configuration command, or you can
manually re-enable it by entering the shutdown and no
shutdown interface configuration commands.
Step 7
switchport port-security mac-address
mac-address [vlan vlan-id]
(Optional) Enter a static secure MAC address for the interface, repeating
the command as many times as necessary. You can use this command to
enter the maximum number of secure MAC addresses. If you configure
fewer secure MAC addresses than the maximum, the remaining MAC
addresses are dynamically learned.
(Optional) On a trunk port, you can specify the VLAN ID along with the
MAC address. If no VLAN ID is specified, the native VLAN is used.
Note
If you enable sticky learning after you enter this command, the
secure addresses that were dynamically learned are converted to
sticky secure MAC addresses and are added to the running
configuration.
Step 8
switchport port-security mac-address
sticky
(Optional) Enable sticky learning on the interface.
Step 9
end
Return to privileged EXEC mode.
Step 10
show port-security
Verify your entries.
Step 11
copy running-config startup-config
(Optional) Save your entries in the configuration file.
Command
Purpose