port-security enable
Syntax
port-security enable
undo port-security enable
View
System view
Default level
2: System level
Parameters
None
Description
Use port-security enable to enable port security.
Use undo port-security enable to disable port security.
By default, port security is disabled.
You must disable global 802.1X and MAC authentication before you enable port security on a port.
Enabling or disabling port security resets the following security settings to the default:
802.1X access control mode is MAC-based, and the port authorization state is auto.
Port security mode is noRestrictions.
You cannot disable port security when online users are present.
Related commands: display port-security, dot1x, dot1x port-method, dot1x port-control, and mac-authentication.
Examples
# Enable port security.
<Sysname> system-view [Sysname] port-security enable