This example shows how to configure a static secure MAC address on VLAN 3 on a port:
Switch(config)#
interface gigabitethernet1/0/2
Switch(config-if)#
switchport mode trunk
Switch(config-if)#
switchport port-security
Switch(config-if)#
switchport port-security mac-address 0000.0200.0004 vlan 3
This example shows how to enable sticky port security on a port, to manually configure MAC addresses for
data VLAN and voice VLAN, and to set the total maximum number of secure addresses to 20 (10 for data
VLAN and 10 for voice VLAN).
Switch(config)#
interface tengigabitethernet1/0/1
Switch(config-if)#
switchport access vlan 21
Switch(config-if)#
switchport mode access
Switch(config-if)#
switchport voice vlan 22
Switch(config-if)#
switchport port-security
Switch(config-if)#
switchport port-security maximum 20
Switch(config-if)#
switchport port-security violation restrict
Switch(config-if)#
switchport port-security mac-address sticky
Switch(config-if)#
switchport port-security mac-address sticky 0000.0000.0002
Switch(config-if)#
switchport port-security mac-address 0000.0000.0003
Switch(config-if)#
switchport port-security mac-address sticky 0000.0000.0001 vlan voice
Switch(config-if)#
switchport port-security mac-address 0000.0000.0004 vlan voice
Switch(config-if)#
switchport port-security maximum 10 vlan access
Switch(config-if)#
switchport port-security maximum 10 vlan voice
Related Topics
Port Security, on page 406
Enabling and Configuring Port Security, on page 411
Additional References
Error Message Decoder
Link
Description
https://www.cisco.com/cgi-bin/Support/Errordecoder/
index.cgi
To help you research and resolve system error
messages in this release, use the Error Message
Decoder tool.
MIBs
MIBs Link
MIB
To locate and download MIBs for selected platforms,
Cisco IOS releases, and feature sets, use Cisco MIB
Locator found at the following URL:
All supported MIBs for this release.
Catalyst 2960-X Switch Security Configuration Guide, Cisco IOS Release 15.0(2)EX
OL-29048-01
433
Configuring Port-Based Traffic Control
Additional References