show port-security
Summarises every port-security-enabled port: maximum and current MAC count, violation count and violation action.
Written by a working field network engineer · CCNA, Security+, CySA+
The summary table for port security across the switch. One line per secured port shows how many MAC addresses it allows, how many it currently holds, how many violations it has seen and what it does about them.
Example output
SW1#show port-security
Secure Port MaxSecureAddr CurrentAddr SecurityViolation Security Action
(Count) (Count) (Count)
---------------------------------------------------------------------------
Fa0/1 2 1 0 Restrict
Fa0/2 1 1 0 Shutdown
---------------------------------------------------------------------------
Total Addresses in System (excluding one mac per port) : 0
Max Addresses limit in System (excluding one mac per port) : 4096Reference output: hand-written in standard Cisco IOS format for this example network, not captured from a device.
Useful variants
show port-security interface Fa0/1show port-security address
What each column or field means
| Field | Meaning |
|---|---|
MaxSecureAddr | The maximum number of MAC addresses allowed (switchport port-security maximum). Default 1. |
CurrentAddr | Secure addresses currently held: static, sticky and dynamically learned. |
SecurityViolation | How many violations have occurred. With shutdown mode this stops at 1 because the port goes err-disabled. |
Security Action | Shutdown (err-disable the port), Restrict (drop and log, count) or Protect (drop silently). |
When it doesn’t look right
A port is missing from the table.
Port security is configured but not enabled. The bare switchport port-security command is what turns it on, and the port must be a static access (or trunk) port, not dynamic.
SecurityViolation count climbing with Restrict.
A new device is plugged in behind the port, or a phone and PC share it with maximum 1. Raise the maximum or clear stale sticky addresses.
Related commands
- show port-security interface
- show port-security address
- show interfaces status err-disabled
- show errdisable recovery
Try it yourself
- Switchport Port Security (free)
- Port Security Maximum MAC Count (Pro)
- Port Security Violation Action (Pro)
- A Complete Port Security Policy (Pro)
Learn it in the CCNA path
- Layer 2 Port Security (5. Security Fundamentals)
- Limit secure MAC addresses and verify sticky learning (5. Security Fundamentals)
- Compare port-security violation modes and recovery (5. Security Fundamentals)
Topic
Port Security — Limit which MAC addresses an access port accepts, choose a violation action, learn sticky addresses and recover err-disabled ports.