port security
This command enables or configures port security. Use the
no
form without any
keywords to disable port security. Use the
no
form with the appropriate keyword to
restore the default settings for a response to security violation or for the maximum
number of allowed addresses.
Syntax
port security [action {shutdown | trap | trap-and-shutdown}
|
max-mac-count
address-count]
no port security [action | max-mac-count]
action - Response to take when port security is viol ated.
- shutdown - Disable port only.
- trap - Issue SNMP trap message only.
- trap-and-shu tdown - Issue SNMP trap message and di sable port .
max-mac-count
- address-count - The maxim um num ber of MAC addresse s that can be
learned on a port. (Range: 0 - 1024, where 0 m eans d isable d)
Default Setting
• Status: Disabled
• Action: None
Maximum Addresses: 0
Command Mode
Interface Configuration (Ethernet)
Command Usage
When port security is enabled with this comm and, t he s witch fir st cl ears all
dynamically learned entries from the address table. It then starts learning new
MAC addresses on the specified port, and stops learning addresses when it
reaches a configured maximum number. Only incoming traffi c wi th so ur ce
addresses already stored in the dynamic or static address table will be
accepted.
• First use the port security max-mac-count comman d to set th e number of
addresses, and then use the p ort sec urity co mman d to enab le secu rity on
the port. (The specified maximum address count is effective when port
security is enabled or disabled.)
• Use the no port security max-mac-count comm a nd to disable port security
and reset the maximum number of addresses to the default.
You can also manually add secure addresses with the ma c-add res s-ta ble
static
command.
A secure port has the following restrictions:
- Cannot be connected to a network interconn ection devic e.
- Cannot be a trunk port .
If a port is disabled due to a security violation, it must be m anually re-enabled
using the
no
shutdown
command.
25-25Port Security Commands
25