Cannot configure secure MAC addresses

Symptom

Cannot configure secure MAC addresses.

[Device-Ethernet1/0/1] port-security mac-address security 1-1-2 vlan 1
Error: Security MAC address configuration failed.

Analysis

No secure MAC address can be configured on a port operating in a port security mode other than autoLearn.

Solution

Set the port security mode to autoLearn.

[Device-Ethernet1/0/1] undo port-security port-mode
[Device-Ethernet1/0/1] port-security max-mac-count 64
[Device-Ethernet1/0/1] port-security port-mode autolearn
[Device-Ethernet1/0/1] port-security mac-address security 1-1-2 vlan 1