The administrator can enable the switch to dynamically learn the MAC address and “stick” them to the running configuration by using the following command:
Switch(config-if)# switchport port-security mac-address sticky
When the device reboots, the MAC addresses are still configured