IntermediatePublished 2026-06-30
CCNA Port Security: Violation Protect vs Restrict
Bundle lab
Deploy and compare the two non-disabling port-security violation modes on host-facing access ports. Build a small Layer-2 topology with a trunk between two switches and same-VLAN hosts. Configure violation protect on one access port and restrict on another using deterministic sticky MAC entries. Validate baseline reachability, then observe the different behaviors: protect silently drops with no counter/logs; restrict drops and increments the violation counter.
Learning objectives
- Configure switchport port-security on host-facing access ports (maximum 1, sticky MAC, violation mode).
- Contrast violation protect vs restrict behavior and expected counters/logging.
- Verify port-security state and counters with show port-security and show port-security interface.
- Maintain correct Layer-2 design: access ports for hosts; 802.1Q trunk between switches carrying user VLANs.
Troubleshooting focus
- If hosts cannot ping in the baseline, confirm both access ports are in VLAN 20 and the inter-switch link is an 802.1Q trunk allowing VLAN 20.
- If protect mode shows a nonzero violation count, re-check the mode; protect should not increment the counter (restrict does).
- If restrict mode counter stays at 0 after testing, ensure test traffic was actually sent (ping from the host) and the sticky entry does not match the real host MAC.
- If a port goes err-disabled, verify you did not configure violation shutdown (this lab uses protect and restrict only).
- Never apply port-security on the trunk; it must remain a pure 802.1Q link.
Topology
Subscribe to preview this lab's topology.
See plansGrade your work
How this lab is graded
- Build it your way. Where a lab lets you choose a value — a VLAN name, an interface description — grading checks that you configured it, not which name you picked. Names that another line has to reference, like an ACL applied with
access-class, are stated in the guide and do have to match. - Addresses, modes and protocol keywords are exact. An IP address, a subnet mask,
switchport mode trunk, an encapsulation — these carry the meaning of the lab, so they are graded as written in the guide. - Grading reads your saved configuration. Export the lab from CML after you have configured it, and make sure anything you set is in the running-config — a change that only exists in a terminal session never reaches the grader.
- You can submit as many times as you like. Your best score stands, and each attempt tells you which checks passed so you can work the gaps.
- Scored something you believe is correct? Use Report an issue on this page — that is exactly how the grading fixes in the changelog got found.
Create a free account to submit your lab for grading.
Create a free accountFound a problem with this lab?
Please sign in to report a problem — tying it to your attempts lets us reproduce and fix it faster.