1-7Setting the Port Security ModeConfiguration PrerequisitesBefore setting the port security mode, ensure that:z 802.1X is disabled, the port access control method is macbased, and the port access control modeis auto.z MAC authentication is disabled.z The port does not belong to any aggregation group.The above requirements must be all met. Otherwise, you will see an error message and yourconfiguration will fail. On the other hand, after setting the port security mode on a port, you cannotchange any configurations of the first three requirements.z With port security disabled, you can configure the port security mode, but your configuration doesnot take effect.z You cannot change the port security mode of a port when any user is present on the port.z Before configuring the port to operate in autoLearn mode, set the maximum number of secure MACaddresses allowed on a port.Configuring ProcedureFollow these steps to enable any other port security mode:To do… Use the command… RemarksEnter system view system-view —Set an OUI value for userauthenticationport-security oui oui-value indexindex-valueOptionalNot configured by default.The command is required for theuserlogin-withoui mode.Enter interface view interface interface-type interface-number —Set the port security modeport-security port-mode { autolearn |mac-authentication |mac-else-userlogin-secure |mac-else-userlogin-secure-ext | secure |userlogin | userlogin-secure |userlogin-secure-ext |userlogin-secure-or-mac |userlogin-secure-or-mac-ext |userlogin-withoui }RequiredBy default, a port operates innoRestrictions mode.