17-5
Catalyst 2940 Switch Software Configuration Guide
78-15507-02
Chapter17 Configuring Port-Based Tra ffic Control Configuring Port Security
Switch# show interfaces gigabitethernet0/1 switchport
Name: Gi0/1
Switchport: Enabled
<output truncated>
Protected: True
Unknown unicast blocked: disabled
Unknown multicast blocked: disabled
Configuring Port Security
You can use the port security feature to restrict input to an interface by limiting and identifying MAC
addresses of the stations allowed to access the port. When you assign secure MAC addresses to a secure
port, the port does not forward packets with source addresses outside the group of defined addresses.
This section includes information about these topics:
Understanding Port Security, page 17-5
Default Port Security Configuration, page 17-7
Port Security Configuration Guidelines, page 17-7
Enabling and Configuring Port Security, page 17-7
Enabling and Configuring Port Security Aging, page 17-10

Understanding Port Security

This section includes information about:
Secure MAC Addresses, page 17-5
Security Violations, page 17-6

Secure MAC Addresses

You can configure these types of secure MAC addresses:
Static secure MAC addresses—These are manually configured by using th e switchport
port-security mac-address mac-address interface configuration command, stored in the address
table, and added to the switch running configuration.
Dynamic secure MAC addresses—These are dynamically learned, stored only in the address table,
and removed when the switch restarts.
Sticky secure MAC addresses—These can be dynamically learned or manually configured, stored in
the address table, and added to the running configuration. If these addresses are saved in the
configuration file, the interface does not need to dynamically relearn them when t he switch resta rts.
Although sticky secure addresses can be manually configured, we do not recommend it.
You can configure an interface to convert the dynamic MAC addresses to sticky secure MAC addresses
and to add them to the running configuration by enabling sticky learning. To enable sticky learning, enter
the switchport port-security mac-address sticky interface configuration command. When you enter
this command, the interface converts all the dynamic secure MAC addresses, including those that were
dynamically learned before sticky learning was enabled, to sticky secure MAC addresses.