Hands-On Lab: Configuring Errdisable Recovery

This hands-on lab triggers a port security violation that places a port into err-disabled state, then configures automatic errdisable recovery so the port re-enables itself after a timeout instead of requiring manual intervention.

Errdisable RecoveryErr-Disabled StateAutomatic Port Recovery

~3 min read · Updated Sep 22, 2026

Lab Objective

Trigger a port security violation causing a port to enter err-disabled state, manually recover it once, then configure automatic errdisable recovery so future violations of the same type recover on their own after a configurable timeout.

Lab Purpose

A port placed into err-disabled state, discussed earlier in this series regarding port security, stays down until an administrator manually cycles it with shutdown and no shutdown. In environments where the same transient trigger (such as a brief power blip causing a spurious violation) occurs occasionally, automatic recovery avoids unnecessary help desk tickets and downtime.

Lab Topology

Switch1 ---- Gi1/0/5 ---- PC (port security configured,
                          maximum 1 MAC address)

Task 1: Configure Port Security

Configure Gi1/0/5 with port security allowing a maximum of 1 MAC address, with a violation action of shutdown.

Task 2: Trigger the Violation

Connect a second device (or simulate a second MAC address) on the same port to trigger a security violation.

Task 3: Verify the Port Is Err-Disabled

Confirm the port shows an err-disabled status.

Task 4: Manually Recover the Port

Manually cycle the port to restore it.

Task 5: Configure Automatic Errdisable Recovery

Configure the switch to automatically recover ports from err-disabled state caused by port security violations after 300 seconds.

Task 6: Verify Automatic Recovery Configuration

Trigger the violation again and confirm the port automatically returns to service after the configured interval without manual intervention.

Solution and Verification

Switch1(config)# interface gigabitethernet1/0/5
Switch1(config-if)# switchport mode access
Switch1(config-if)# switchport port-security
Switch1(config-if)# switchport port-security maximum 1
Switch1(config-if)# switchport port-security violation shutdown
Switch1(config-if)# switchport port-security mac-address sticky

-- A second device connects to Gi1/0/5

Switch1# show interfaces gigabitethernet1/0/5 status

Gi1/0/5    err-disabled

Switch1# show port-security interface gigabitethernet1/0/5 | include Violation

Security Violation Count   : 1

Switch1(config)# interface gigabitethernet1/0/5
Switch1(config-if)# shutdown
Switch1(config-if)# no shutdown

Switch1# show interfaces gigabitethernet1/0/5 status
Gi1/0/5    connected

Switch1(config)# errdisable recovery cause psecure-violation
Switch1(config)# errdisable recovery interval 300

Switch1# show errdisable recovery

ErrDisable Reason    Timer Status
psecure-violation     Enabled
Timer interval: 300 seconds

-- The violation is triggered again

Switch1# show interfaces gigabitethernet1/0/5 status
Gi1/0/5    err-disabled

-- After waiting 300 seconds, with no manual
-- intervention:

Switch1# show interfaces gigabitethernet1/0/5 status
Gi1/0/5    connected
-- The port automatically recovered without
-- requiring shutdown / no shutdown

Key Takeaway

Errdisable recovery must be enabled per specific cause (psecure-violation, bpduguard, and others each have their own independent recovery setting) rather than globally for every possible err-disable trigger, giving an administrator precise control over which specific failure types are allowed to self-heal versus which should always require manual investigation.

Written & researched by Dr. Shahin Siami

Related Articles

Hands-On Lab: Configuring IPv6 Static Routes

This hands-on lab configures static routes for IPv6 destinations between two routers, mirroring the IPv4 static routing syntax covered earlier in this series while highlighting the IPv6-specific command keyword and address format.

Continue

Hands-On Lab: Configuring Default Static Routes

This hands-on lab configures a default static route on an edge router to reach the internet through an ISP connection, demonstrating how a single route can represent every otherwise-unknown destination rather than requiring individual routes for each one.

Continue

Hands-On Lab: Configuring and Naming Static Routes

This hands-on lab configures static routes with descriptive names attached using the name keyword, improving documentation and making the routing table significantly easier to interpret for anyone reviewing the configuration later.

Continue

Hands-On Lab: Configuring Static Routing via IP Addresses

This hands-on lab configures static routes using a next-hop IP address rather than an outgoing interface, the generally preferred syntax, and compares the resulting routing table entry against the interface-based approach from the previous lab.

Continue

Hands-On Lab: Configuring Static Routing via Interfaces

This hands-on lab configures static routes using an outgoing interface rather than a next-hop IP address, demonstrating this approach's suitability for point-to-point links and its important limitation on multi-access networks.

Continue

Hands-On Lab: Installing a Wireless LAN Controller

This hands-on lab performs the initial setup of a Wireless LAN Controller, joins a lightweight access point to it, and creates a centrally managed WLAN, demonstrating the controller-based architecture that scales far beyond standalone access points.

Continue
Hands-On Lab: Configuring Errdisable Recovery | Dr. Shahin Siami