BuildTheNet

Opening your workspace

Your learning content and tools are loading.

Port Security

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) : 4096

Reference output: hand-written in standard Cisco IOS format for this example network, not captured from a device.

Useful variants

What each column or field means

FieldMeaning
MaxSecureAddrThe maximum number of MAC addresses allowed (switchport port-security maximum). Default 1.
CurrentAddrSecure addresses currently held: static, sticky and dynamically learned.
SecurityViolationHow many violations have occurred. With shutdown mode this stops at 1 because the port goes err-disabled.
Security ActionShutdown (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

Try it yourself

Learn it in the CCNA path

Topic

Port Security — Limit which MAC addresses an access port accepts, choose a violation action, learn sticky addresses and recover err-disabled ports.

All 57 commands