1-9
z If the amount of security MAC addresses has not yet reach the maximum number, the port will
learn new MAC addresses and turn them to security MAC addresses;
z If the amount of security MAC addresses reaches the maximum number, the port will not be able to
learn new MAC addresses and the port mode will be changed from autolearn to secure.
The security MAC addresses manually configured are written to the configuration file; they will not get
lost when the port is up or down. As long as the configuration file is saved, the security MAC addresses
can be restored after the switch reboots.
Configuration prerequisites
z Port security is enabled.
z The maximum number of security MAC addresses allowed on the port is set.
z The security mode of the port is set to autolearn.
Configuring a security MAC address
Follow these steps to configure a security MAC address:
To do... Use the command... Remarks
Enter system view
system-view
—
In system
view
mac-address security mac-address
interface interface-type interface-number vlan
vlan-id
interface interface-type interface-number
Add a security
MAC address
In Ethernet
port view
mac-address security mac-address vlan
vlan-id
Either is
required.
By default, no
security MAC
address is
configured.
Displaying and Maintaining Port Security Configuration
To do... Use the command... Remarks
Display information about port
security configuration
display port-security [ interface interface-list ]
Display information about
security MAC address
configuration
display mac-address security [ interface
interface-type interface-number ] [ vlan vlan-id ]
[ count ]
Available in
any view