Port Security on HPE Aruba ArubaOS-Switch

How to configure port security on HPE Aruba ArubaOS-Switch — limiting MAC addresses per port, static MAC binding, dynamic learning lockdown, and clearing intrusion flags.

2 min readUpdated KNET Ltd

Port security is a form of MAC lockdown (layer 2 control). It lets you limit, restrict or fix the MAC addresses allowed on an individual switch port, and decide what the switch does when that rule is broken. This applies to the HPE Aruba 2920, 2930, 3800, 5400 and 8200 series running ArubaOS-Switch.

I wrote this after a reader asked how to set it up. These are the scenarios I use most.

Tip: Start with action send-alarm when first deploying port security. This alerts your NMS (such as HPE IMC) without disrupting traffic, letting you validate before enforcing.

Learn modes #

Learn modeBehaviour
continuous (default)Any MAC address is learned as a device connects
staticMAC addresses can be pre-defined; other addresses can also be learned
configuredMAC addresses can be pre-defined; no other MAC addresses can be learned
limited-continuousMAC addresses are learned, up to the address-limit
port-accessUsed with 802.1x to temporarily learn the MAC address of an authenticated session

Scenario 1 — Limit to 2 MACs, learn dynamically, disable on violation #

cli
port-security 1-24 address-limit 2 learn-mode limited-continuous action send-disable

After a violation, the switch waits the MAC age time (default 300 seconds) before learning new MACs. Check or adjust with:

cli
show system-information
mac-age-time 60-999960

Scenario 2 — Static MAC binding, disable on violation #

cli
port-security 25 learn-mode configured mac-address 0000.ffff.0000 action send-disable

Scenario 3 — Sticky MAC learning, lock permanently #

cli
port-security 25 learn-mode static action send-disable

Scenario 4 — Send alarm to NMS instead of disabling #

cli
port-security 1-24 address-limit 2 learn-mode limited-continuous action send-alarm

Clear an intrusion flag #

cli
port-security 1 clear-intrusion-flag