Switch Port Security

Ch. 6 of 616 mins3 Tasks

Harden campus switch ports against unauthorized devices. Configure MAC address limits, sticky learning, and enforce shutdown violation actions to protect corporate cubicles.

Track Series

Chapters in this Track (Ch. 6 of 6)

6Switch Port Security
16m

Picture a typical corporate office building. The cybersecurity team spends millions on next-generation firewalls, spam filters, and strict passwords. Yet right in the reception waiting area and empty meeting rooms, live Ethernet wall ports sit completely open and ready for anyone to plug in.

If an uninvited guest plugs their personal laptop into one of those wall ports, a standard switch will gladly learn their MAC address, give them network access, and let them browse internal servers. Securing those physical doors is the job of Port Security.

The Danger of MAC Flooding

Even worse, an intruder can run a tool that generates thousands of fake, random MAC addresses every second. A standard switch only has enough memory in its CAM table to remember a few thousand devices. When that table fills up completely, the switch panics and fails open: it turns into an old-fashioned hub, broadcasting every single private frame out of every port in the building. Anyone listening on that wall jack can suddenly capture private company emails and passwords passing by.

To put a stop to physical wall jack exploits, network engineers configure Switch Port Security.

How Port Security Protects Cubicles

Port Security turns an open switch port into an intelligent door that only opens for authorized devices:

  1. Setting a Device Limit: By default, an access port allows only one single MAC address. If an employee brings an unauthorized mini-switch to connect their personal laptop and phone at their desk, the switch notices multiple devices and blocks the traffic.
  2. Sticky MAC Learning: Nobody wants to manually look up and type 48-bit hexadecimal addresses for three hundred office computers. With mac-address sticky, the switch automatically learns the MAC address of the first authorized computer plugged in and saves it as the permanent owner of that port.
  3. Enforcing the Rule: When an unknown device plugs in, the switch responds according to its configured violation mode:
Violation Mode Does It Drop Traffic? Does It Send an Alert? Does It Turn Off the Port?
Protect Yes No No (Port stays up)
Restrict Yes Yes (Counts violations) No (Port stays up)
Shutdown Yes Yes (High priority alert) Yes: Port is placed into err-disable state
The err-disable Quarantine State

Under standard Shutdown mode, the moment an unauthorized device sends a single frame, the switch shuts off the port link light and locks the port into err-disable. Even if the intruder quickly unplugs their laptop and plugs the original company PC back in, the port remains physically dead until an IT administrator investigates the alert and manually turns the port back on.

Real-World Tip: Moving Desks Without Lockouts

In busy corporate offices, employees frequently switch desks or receive new laptops. If port security was configured with rigid static addresses, IT staff would spend hours each week manually deleting old addresses and entering new ones.

That is why senior network engineers combine Sticky Learning with MAC Aging. The switch automatically forgets inactive MAC addresses after an employee leaves for the day. If someone moves to a new desk overnight, the old wall jack quietly releases its binding, allowing the next authorized workstation to plug in without triggering a security lockout.

Recovering from an err-disable Lockout

When a port is placed into the err-disable state, it remains completely offline even after the unauthorized guest unplugs their cable. To bring the port back to life, a network technician inspects the switch logs to confirm what device caused the violation. Once the area is secure, the administrator resets the interface by running a quick shutdown followed by a no shutdown command.

In large campus networks, administrators also configure automated recovery timers. By setting an err-disable recovery interval, the switch automatically tests the port after five minutes. If the rogue device has been unplugged and the authorized workstation is back in place, the port safely reactivates without requiring emergency IT intervention.

Campus Switching: The Complete Picture

Congratulations on completing the Campus Switching module! You now understand how modern office networks divide noisy departments with VLANs, carry multi-department traffic across 802.1Q trunks, route between subnets using Router-on-a-Stick, prevent loops with Spanning Tree, and lock down physical cubicle ports with Port Security.

In your final practice lab on the right, you can inspect the port security configuration on switch SW1, generate initial traffic from the authorized workstation, and verify that the switch permanently locks its secure CAM table to protect your corporate network from intruders.

Hands-On Practice Checklist

Progress:0 / 3

Perform actions on the practice lab canvas on the right. Tasks automatically check off as you connect cables and run commands.

Task 1: Inspect Port Security Status on Switch

Click Office Switch SW1, open Ports tab, select port Fa0/1, and verify that Port Security is enabled with a Maximum MAC limit of 1 and violation mode set to Shutdown.

Task 2: Transmit Traffic from Authorized Workstation

Open Authorized-PC Terminal and run "ping 192.168.1.1" to send frames to the central server. Confirm that traffic is permitted through the secured port.

Task 3: Verify Secure MAC Address Registration

In SW1 Ports tab, verify that Authorized-PC MAC address is now permanently bound as the active secure hardware address on port Fa0/1.