Users Guide

Layer 2 Switching Commands 308
console(config)#do write
switchport port-security (Interface Configuration)
Use the switchport port-security command to enable or configure port
security (MAC locking) globally. Use the no form of the command to disable
port security globally.
Syntax
switchport port-security [dynamic { value | vlan {vlan-id | range vlan-
range } maximum limit } | mac-address {mac-address vlan vlan-id | sticky
[mac-addr vlan vlan-id ] } | maximum {val} | violation {protect |
shutdown} ]
no switchport port-security [dynamic [vlan {vlan-id | range vlan-range} ] |
mac-address { mac-addr vlan vlan-id| sticky} | maximum | violation ]
mac-address — The static MAC address to be configured on the interface
and VLAN.
vlan-id — The VLAN identifier on which to configure the MAC address.
dynamic — Configure the maximum number of dynamic MAC addresses
that be be learned on the interface. Setting the dynamic limit to 0 causes
all received packets with non-static MAC addresses to be considered as
violations.
sticky – Configure a sticky MAC address on the interface. If the sticky
parameter not given, a statically locked MAC address is configured on the
interface.
maximum <
limit
> — Configure the maximum number of static MAC
addresses that may be learned on the interface or VLAN.
violation—Configure the interface to:
protect—Protect the interface or VLAN by discarding MAC frames
that are not learned (default) and issuing a log message and a trap.
shutdown—Protect the interface or VLAN by error disabling the
interface and issuing a log message and a trap. If the MAC address
limit is exceeded for a VLAN, the ports participating in the VLAN are
shut down.