The port-security max-mac-num command sets the maximum number of secure MAC addresses that can be learned on an interface.
The undo port-security max-mac-num command restores the default maximum number of secure MAC addresses that can be learned on an interface.
By default, only one MAC addresses can be learned on an interface.
Parameter |
Description |
Value |
---|---|---|
max-number |
Specifies the maximum number of secure MAC addresses that can be learned by an interface. |
The value is an integer that ranges from 1 to 1024. |
Ethernet interface view, GE interface view, XGE interface view, 25GE interface view, MultiGE interface view, 40GE interface view, 100GE interface view, Eth-Trunk interface view, port group view
Usage Scenario
After enabling port security on an interface, you can run the port-security max-mac-num command to limit the number of MAC addresses that the interface can learn. If the switch receives packets with a nonexistent source MAC address after the number of secure MAC addresses reaches the limit, the switch considers that the packets are sent from an unauthorized user, regardless of whether the destination MAC address of packets is valid, and takes the action configured using the port-security protect-action command on the interface. This prevents untrusted users from accessing these interfaces, improving security of the switch and the network.
Precautions