Open the lab

[ YOUR LAB FILE ]

Download the starting topology, then work through the lesson in SwitchLab.

Download SwitchLab Lab (.swlab)

  1. Save the .swlab file without renaming its extension.
  2. Open SwitchLab. Import and export controls currently require a desktop-width window. On a smaller screen, Tools → Fit brings the topology into view.
  3. Select Import Sandbox (folder icon), choose the downloaded file, and confirm the device and cable counts below.
  4. Select a device, then choose Open device on desktop or its name in the bottom bar on smaller screens. Select CLI for switches/routers or Desktop → Terminal for PCs. Enter enable only when the prompt ends in >.
  5. Follow this page beside the simulator. Use a free account to export your work. Reimport the original download to restart; export any work you want to keep first.

Prerequisites

  • Complete Ethernet MAC learning and VLAN access-port lessons.

Follow the CCNA study path · Browse all SwitchLab labs

Topology

Recover from a Port-Security Violation: starting network imported into the SwitchLab sandbox.
Starting topology captured in SwitchLab. Select the image to view it at full size.

3 devices · 2 links

Scenario

PC1 was replaced, but the switch still permits the old workstation MAC. A transmission from the replacement triggers shutdown-mode security. Update the authorized MAC and recover the port.

Objectives

  • Verify the approved MAC-to-access-port association.
  • Enforce port security while restoring legitimate host traffic.

CCNA blueprint

200-301 v1.1 objectives — this lab covers the following specific skills, not every subtopic in the domain.

  • 5.7 — Configure and verify Layer 2 port-security controls.

Starting information

  • PC1 connects to SW1 g0/1 with approved MAC 0011.2233.4455. PC2 on g0/2 is the delivery control. Both are in VLAN 10.
  • Maximum secure MAC count is 1. Approved violation mode is shutdown.
  • The old/mismatched MAC 0011.2233.9999 is not authorized for PC1’s port. Keep port security enabled in the final configuration.
HostIPv4 addressMaskGateway
PC1192.168.10.10255.255.255.0None
PC2192.168.10.20255.255.255.0None
Device / portDevice / port
PC1 / eth0SW1 / g0/1
PC2 / eth0SW1 / g0/2

Tasks

  1. Inspect PC1’s physical address with ipconfig /all, then generate a ping to 192.168.10.20 and inspect show port-security interface g0/1.
  2. Apply the approved secure MAC, maximum count and violation mode on SW1 g0/1. Remove the old secure MAC first and use shutdown/no shutdown after correcting it to recover the interface.
  3. Verify the exact secure MAC and enabled security state, then test PC1 → PC2 and PC2 → PC1.
  4. Save/export and reload. Confirm the intended secure MAC remains configured and approved-host traffic still works.

Useful commands

show running-config interface g0/1
show port-security interface g0/1
copy running-config startup-config

Progressive hints

Hint 1

Compare the PC’s actual MAC with the configured secure MAC; an unchanged IP address does not preserve hardware identity.

Hint 2

A security violation is distinct from an administratively shut port. Correct the authorization before recovering a shutdown-mode violation.

Hint 3

Remove the stale secure MAC, configure 0011.2233.4455 on g0/1, keep maximum 1 and the approved violation mode, then recover the interface if needed.

Verification

  • SW1 g0/1 retains port security with the approved secure MAC and mode.
  • PC1 and PC2 communicate after the repair and after export/reload.
  • A mismatched authorized MAC prevents PC1’s required delivery.

Solution / walkthrough

Show Solution

Use enable only from a > prompt; if already at #, begin with configure terminal.

SW1

Correct the authorized device identity instead of disabling the protection. Recovery follows the MAC correction in the shutdown-mode scenario.

enable
configure terminal
interface g0/1
switchport mode access
no switchport port-security mac-address 0011.2233.9999
switchport port-security maximum 1
switchport port-security mac-address 0011.2233.4455
switchport port-security violation shutdown
switchport port-security
shutdown
no shutdown
end
copy running-config startup-config

Run every verification check above after the changes. A saved configuration alone does not prove packet delivery.

Previous lab

Protect a Host Access Port with a Secure MAC

Related labs

Related articles and tools

Next recommended lab

Separate Host, Switching and Routing Faults