Home › Topics › Rogue Device Detection › Port Security and 802.1X Signals

Port Security and 802.1X as Detection Signals


Most rogue detection works by collecting what the network already knows and comparing it against what you expect. There is a faster way: tell the switch what you expect, and let it do the comparison at the instant something plugs in. That is what port security and 802.1X are. They are usually described as access-control features, ways to keep unauthorized devices off the network. They are that. But they are also the best rogue detectors you own, because every time they refuse something, they write down exactly which port it happened on.


The catch is that the same features can lock out your own printers, phones, and the CEO's docking station at eight on a Monday morning. And a feature that does that twice gets turned off forever. This guide explains both features in plain language. It shows you how to route their violations and failures into your monitoring as detection events. It teaches you to read a burst of failures across many ports. And it lays out a rollout order that gets you the detection value long before you risk the lockouts.


In this guide

  • Port security in plain language
  • 802.1X in plain language
  • Violations and failures as detection events
  • Reading a burst of failures
  • Balancing detection against lockouts
  • A rollout order that will not get you fired
  • Violation type, likely cause, and response
  • Where to go next

Port security in plain language


A switch learns MAC addresses on its ports automatically and without limit; that is its job. Port security adds a rule to a port: only this many MAC addresses, and optionally only these specific ones. Three settings do nearly all the work.


The MAC limit

The maximum number of MAC addresses the port will accept. A desk port with one PC gets a limit of one. A desk port with a phone and a PC behind it gets two. On many switches, that means one on the voice VLAN and one on the data VLAN. A port that then sees a third MAC has, by definition, something unexpected plugged in — very often a desk switch or a bridged access point. The limit is the simplest rogue detector there is, and it needs no list of allowed devices to work.


Sticky MACs

With "sticky" learning, the switch remembers the first MACs it sees on the port (up to the limit). It writes them into its configuration as the allowed set. Nobody types addresses in by hand; the switch learns the desktop that lives there and thereafter treats any different MAC as a violation. Sticky MACs turn the limit from "how many" into "which ones," which catches the case where somebody unplugs the desktop and plugs in something else. They also create the classic lockout: swap a user's PC without clearing the sticky entry and the new PC is refused.


The violation action

What the switch does when the rule is broken. Vendors use different names, but there are three behaviors:


  • Protect: silently drop traffic from the offending MAC. The port stays up, allowed devices keep working, and nothing is logged. Useless for detection, because it hides the event.
  • Restrict: drop the offending traffic and log it, increment a violation counter, and send an SNMP trap. The port stays up. This is the detection sweet spot: the rogue is blocked, the legitimate device is unaffected, and you get told.
  • Shutdown: put the port into an error-disabled state, cutting off everything on it, and log the event. Maximum enforcement, maximum lockout risk, and also a detection signal — you will certainly hear about it.

Here is the shape of a port-security configuration. Syntax varies by vendor; the concepts do not:


interface GigabitEthernet1/0/17
 description Rm 214 jack B - desk
 switchport mode access
 switchport port-security
 switchport port-security maximum 2
 switchport port-security mac-address sticky
 switchport port-security violation restrict

Two MACs allowed, learned automatically, and a third one gets dropped and reported while the desk keeps working. Note the description line: when the violation message arrives, that description is what turns "Gi1/0/17" into a room.


802.1X in plain language


Port security asks "how many, and which MACs?" 802.1X asks a harder question: "who are you, and can you prove it?" When a device connects to an 802.1X-enabled port, the port refuses to pass normal traffic until the device presents credentials. Those can be a username and password, or more commonly a certificate installed by your management tooling. The switch forwards those credentials to an authentication server (a RADIUS server, in nearly every real deployment). The server answers yes or no, and can also say which VLAN the device belongs on. Only then does the port open.


Three roles appear in every description of 802.1X and are worth naming once. The supplicant is the software on the device that presents credentials. The authenticator is the switch (or wireless AP) guarding the port. The authentication server is the RADIUS server that decides. The reason 802.1X is stronger than port security is that a MAC address can be copied but a certificate cannot be guessed. A rogue device on an 802.1X port does not just exceed a limit; it fails an exam.


The fallback for things that cannot log in

Printers, badge readers, cameras, older phones, and most IoT gadgets have no supplicant and never will. For those, switches offer MAC authentication bypass (MAB, though the name varies). When a device does not respond to the credential request, the switch sends the device's MAC address to the authentication server instead. The server checks it against a list of known-device MACs and allows or refuses. It is port security's "which MACs" idea, centralized. It is also weaker than certificate authentication for the same reason — a MAC can be copied. So the devices allowed through MAB should land on a VLAN that matches their trust level, not the staff LAN.


Most switches also offer a guest VLAN or auth-fail VLAN. Rather than leaving a failed device in the dark, put it on an isolated network with internet access and nothing else. For detection this is a gift, because the device stays connected and talking, which means you can watch it, while it cannot reach anything that matters.


Violations and failures as detection events


Both features generate messages when they refuse something. Left alone, those messages go to the switch's local log buffer, which nobody reads, and expire. Turned into detection events, they are the highest-quality rogue alerts you can get. The switch has already decided the device is unexpected, and the message names the port. The pipeline has three stages.


1. Get the events off the switch

Configure every access switch to send its log messages to a central syslog server. Syslog is the standard protocol for shipping log lines over the network. Also configure every access switch to send its SNMP traps (unsolicited "something happened" messages) to your monitoring system. Port-security violations and 802.1X failures both produce log lines; port security typically also raises a trap. Enable both paths; they fail independently and cost nothing. A violation log line looks something like this — wording differs by vendor, but the parts are always there:


%PORT_SECURITY-2-PSECURE_VIOLATION: Security violation occurred, caused by
  MAC address 00:1a:2b:3c:4d:5e on port GigabitEthernet1/0/17.

%DOT1X-5-FAIL: Authentication failed for client (9c:8e:cd:11:22:33)
  on Interface Gi1/0/03 AuditSessionID 0A140A0100000B2C1F3E8D4A

Each line carries the offending MAC and the port. That pairing is the entire value: a MAC tells you what, a port tells you where.


2. Match them in monitoring

Your monitoring or log system needs a rule that recognizes these messages and extracts the MAC and port. Match on the message identifier or on phrases like "security violation" and "authentication failed". The system should then enrich them. Look up the port's description on the switch (the same interface table you already poll over SNMP). Look up the MAC's vendor prefix. If you keep a known-device list, check whether the MAC is in it. A violation from a MAC in your inventory is a misplaced known device. A violation from a MAC you have never seen is a candidate rogue.


3. Alert with the location in the first line

The alert someone actually receives should read, at minimum: what happened, the MAC, the vendor hint, the switch, the port, and the port's description. Like this:


PORT SECURITY VIOLATION - sw-floor2-01 Gi1/0/17 - "Rm 214 jack B - desk"
  Offending MAC: 00:1a:2b:3c:4d:5e  (vendor hint: consumer networking gear)
  Port limit 2, sticky MACs: 3c:52:82:aa:bb:cc (known: PC-214B), d4:be:d9:dd:ee:ff (known: phone)
  Action taken: restrict (offender dropped, port still up)
  Not in known-device list. Third MAC on a two-device desk port.

Compare that with a raw syslog line forwarded verbatim. Same event, but the enriched version can be acted on by whoever is on duty, without logging into anything.


Reading a burst of failures


A single violation on a single port is a device. A burst of violations or authentication failures across many ports at once is a pattern, and patterns have a short list of causes. Learn to read it before you dispatch anyone.


  • Many 802.1X failures, all ports, starting at the same minute: the authentication server is down, unreachable, or refusing the switch. No rogue involved; every legitimate device is failing. Check the RADIUS server and the network path to it first. Most switches can be configured to fall open to a fallback VLAN when the server is unreachable. That is exactly what you want in this scenario.
  • Many failures for the same kind of device, spread over hours: an expired or revoked certificate, or a supplicant change pushed by management tooling. Laptops that were fine yesterday start failing as they reconnect. Look at what changed on the devices, not the network.
  • Many violations on one switch immediately after a configuration change: you (or a colleague) just enabled port security. The limit is too low for the phone-plus-PC desks. Or sticky MACs were cleared and are being relearned. Roll back or fix the limit.
  • A sequence of failures on several ports, one after another, from the same MAC or a small set of MACs: something is being moved from jack to jack, trying each one. That might be a technician testing, or it might be someone looking for an open port. Treat this as the one burst that is a rogue signal, and follow the response procedure with the malicious case in mind.
  • Violations from many different unknown MACs on one port: an unmanaged switch or access point behind that port, with devices coming and going.

The rule of thumb: same time, many places is infrastructure; same device, many places is probing. Many devices, one place is a rogue switch or AP. Get the count-and-distribution view before you get the single-alert view, and route accordingly. The infrastructure case should page the person who owns the authentication server, not the person who walks to desks.


Tip: add a monitoring check on the authentication server itself and on the switches' view of it. Most switches expose per-server RADIUS reachability and timeout counters over SNMP. When the server-down burst happens, a dependency rule can suppress the flood of per-port failures behind one "RADIUS unreachable" alert. That is the difference between one useful page and three hundred useless ones.


Balancing detection against lockouts


Every enforcement feature has a failure mode where it enforces against your own people, and port security's is famous: the err-disabled port. Somebody swaps a desktop over the weekend without clearing the sticky MAC. On Monday at eight the port shuts itself down. The user cannot work, and the ticket queue fills with variations of "the network is broken." Multiply by a department move and you have a bad morning. Three practices keep the balance.


Prefer restrict over shutdown on desk ports. The legitimate device keeps working, the extra device is blocked, and you are told. Shutdown is for ports where any surprise is unacceptable — server rooms, infrastructure closets, ports nobody should touch — not for desks.


Use recovery timers. Most switches can automatically re-enable an err-disabled port after an interval you choose. With a recovery timer, a port disabled by a genuine rogue comes back, sees the rogue still there, and disables again. That is fine, because you have been alerted. With that timer, a port disabled by a Monday-morning PC swap recovers on its own once the sticky entry is corrected. No technician has to drive to the site. The timer converts a hard outage into a self-healing hiccup.


Make clearing sticky entries part of the move process. Whoever moves or replaces a device clears the old sticky MAC on the port as a checklist step. The lockouts that poison port security are almost never caused by rogues; they are caused by legitimate changes that skipped a step.


A rollout order that will not get you fired


You get most of the detection value before you turn on any enforcement at all. Roll out in this order and stop at whatever stage your organization is ready for.


  • 1. Ship the logs. Syslog and traps from every access switch into central collection. No configuration on the ports yet. You are just making sure you will see what happens next.
  • 2. Monitor-only. Enable port security with a generous limit (three or four) and the restrict action. Or enable 802.1X in a monitor mode where authentication runs but failures are logged rather than enforced. Most switches offer this; the name varies. Nothing gets blocked; everything unexpected gets reported. Run this for a few weeks and work through every alert. This stage alone finds most of your desk switches and personal access points.
  • 3. Fix what you found and build the allow list. Every alert from stage two becomes either an inventory entry or a rogue case for the response procedure. The inventory entry is for a legitimate device that needs a MAB entry or a sticky MAC. By the end you know what belongs on every port.
  • 4. Enforce on the ports that matter most. Tighten limits to the real number on desk ports. Turn on real 802.1X enforcement on staff VLANs, with the guest VLAN as the fallback so failed devices land somewhere safe and visible. Use shutdown only on infrastructure ports.
  • 5. Keep the monitoring path alive. Enforcement stops rogues, but the alert is still what tells you a rogue was attempted. If violations stop arriving entirely, check the syslog path before you assume the network is clean.

Two stages of monitor-only before any enforcement feels slow, and it is the reason the enforcement survives. Teams that enable shutdown on day one spend day two turning it off.


Violation type, likely cause, and response


EventMost likely causeFirst response
MAC limit exceeded on a desk port, unknown offending MACDesk switch or bridged AP behind the portCount MACs on the port; walk to the port description's room; follow the response procedure
Sticky MAC mismatch, offending MAC in inventoryLegitimate device swap or move without clearing the sticky entryClear and relearn; add the step to the move checklist; no rogue
Sticky MAC mismatch, unknown offending MACSomething replaced the expected device on that jackTreat as a candidate rogue; check whether the expected device is missing
Port err-disabled, one portViolation with shutdown action; occasionally a cabling faultRead the log for the cause before re-enabling; confirm the recovery timer is set
802.1X failure, one port, device has a supplicantExpired certificate, wrong credentials, or a personal deviceCheck the authentication server's log for the reason; contact the user
802.1X failure, one port, no supplicant responsePrinter-class device with no MAB entry, or an unknown gadgetIdentify by MAC vendor and DHCP hostname; add a MAB entry if legitimate, on the right VLAN
Many 802.1X failures, all ports, same minuteAuthentication server down or unreachableCheck the server and the path; confirm fallback VLAN behavior; suppress per-port alerts under one
Same MAC failing on several ports in sequenceA device being moved jack to jack, possibly probingEscalate; locate the current port immediately; preserve logs
Many unknown MACs, one port, over hoursUnmanaged switch or AP with clients coming and goingSame as the first row, with higher confidence it is an AP

The first response column deliberately starts with "read" or "count" rather than "shut" in almost every row. A violation is the switch telling you something; your job is to understand it before you act. And the port counters give you a second opinion for free. A port that shows a violation and a jump in traffic or errors is telling a more complete story. That is where Interface Metrics That Matter picks up.


Where to go next


Port security limits how many and which MACs a port accepts, with protect, restrict, and shutdown as its responses. 802.1X demands credentials before opening the port at all, with MAC bypass and a guest VLAN for the devices that cannot log in. Both produce events that name the port. Ship these to central logging, enrich them with the port description and a vendor hint, and alert with the location in the first line. Then they become the sharpest rogue detector you have. A burst of failures reads as infrastructure, probing, or a hidden switch depending on its shape. Recovery timers and a monitor-first rollout keep the lockouts from killing the feature.


These events tell you where; the rest of the topic tells you what to do. New-MAC Alerting covers the known-device list your enrichment step depends on. Finding Rogue Access Points handles the many-MACs case. And Rogue Device Response takes the alert from port to room to closed case. The full set is on the Rogue Device Detection pillar page.


Put this into practice with SysPeep Monitor

A violation trap is only useful if something is listening for it and knows which port it came from. SysPeep Monitor auto-discovers your switches and their interfaces. It collects their status and counters over SNMP. It pairs alert rules with dependencies so a RADIUS outage shows up as one alert instead of a flood of per-port failures. The free trial installs on any Windows machine in minutes.

Download Free TrialLearn About SysPeep