Security · 4 min read · 19 November 2026

What Is Port Security on a Switch? Stop Unknown Devices From Connecting

Switch port security explained: limiting MAC addresses per port, sticky learning, violation modes (protect, restrict, shutdown), when to use it and how it compares with 802.1X.

Port security limits which and how many devices can use a switch port, based on MAC address. If an unknown device connects, the switch can drop its traffic, log the event or shut the port down.

How it works

  • Maximum MAC addresses: for example one per desk port, two where a phone has a PC behind it.
  • Sticky learning: the switch remembers the first devices it sees and saves them to the configuration.
  • Violation modes: protect (drop silently), restrict (drop and log), shutdown (disable the port until an admin resets it).

Port security vs 802.1X

Port security802.1X / NAC
IdentifiesMAC address (can be spoofed)User or device credentials
Needs a serverNoYes (RADIUS)
Dynamic VLANsNoYes
EffortLowHigher

Port security is a quick, effective control for cameras, printers and fixed devices; 802.1X is stronger for user devices. Hands-on: port security and MAC limiting.

FAQ

Frequently asked questions

Will port security break IP phones?

Not if you allow enough MAC addresses for the phone and the PC behind it.

What happens when a camera is replaced?

Its MAC changes; clear the old sticky address or the port will block the new camera.

Can attackers bypass it?

By copying an allowed MAC address. Combine with 802.1X or monitoring for stronger protection.

Need help designing your network?

Navijin engineers provide free design consultations, bills of materials and quotations for business projects.