17-5
Catalyst2950 Desktop Switch Software Configuration Guide
78-11380-05
Chapter17 Configuring Port-Based Tra ffic Control Configuring Port Security
Secure MAC Addresses
A secure port can have from 1 to 132 associated secure addresses. After you have set the maximum
number of secure MAC addresses on a port, the secure address es are included in an address table in one
of these ways:
You can configure all secure MAC addresses by using the switchport port-security mac-address
mac-address interface configuration command.
You can allow the port to dynamically configure secure MAC addresses with the MAC addresses of
connected devices.
You can configure a number of addresses and allow the rest to be dynamically configured.
Once the maximum number of secure MAC addresses is co nfigured, they are stored in an address table.
Setting a maximum number of addresses to one and configuring the MAC address of an attache d device
ensures that the device has the full bandwidth of the port.
The switch supports these types of secure MAC addresses:
Static secure MAC addressesThese are manually configured by us in g 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 addressesThese are dynamically configured, stored only in the address
table, and removed when the switch restarts.
Sticky secure MAC addressesThese are dynamically configured, stored in the address t abl e, an d
added to the running configuration. If these addresses are saved in the configurat ion file, when th e
switch restarts, the interface does not need to dynamically reconfigure them.
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. The interface
adds all the sticky secure MAC addresses to the running configuration.
The sticky secure MAC addresses do not automatically become part of the configuration file, which is
the startup configuration used each time the swit ch restar ts. I f you sa v e the s tick y secure MA C addresse s
in the configuration file, when the switch restarts, the interface does not need to relearn the se addre sses.
If you do not save the sticky secure addresses, they are lost.
This is an example of text from the running configuration w he n sti cky learni n g is en ab le d on a n
interface:
<output truncated>
!
interface FastEthernet0/2
switchport mode access
switchport port-security
switchport port-security maximum 6
switchport port-security aging time 5
switchport port-security aging static
switchport port-security mac-address sticky
switchport port-security mac-address 0000.0000.000b
switchport port-security mac-address sticky 0000.0000.4141
switchport port-security mac-address sticky 0000.0000.5050
no ip address
<output truncated>