Try:
Syntax:
system-view
port-security enable
interface interface-type interface-number
port-security max-mac-count 1
port-security port-mode autolearn
mac-address security "mac-address" vlan "number"
Configuration procedure
# Enter system view.
<sw01> system-view
# Enable port security.
[sw01] port-security enable
# Enter Ethernet1/0/1 port view.
[sw01] interface Ethernet 1/0/1
# Set the maximum number of MAC addresses allowed on the port to 1.
[sw01-Ethernet1/0/1] port-security max-mac-count 1
# Set the port security mode to autolearn.
[sw01-Ethernet1/0/1] port-security port-mode autolearn
# Add the MAC address 0001-0002-0003 of Host as a security MAC address to the port in VLAN 1.
[Switch-Ethernet1/0/1] mac-address security 000A-000B-000C vlan 100
Billy