- A
interface G0/1 switchport port-security switchport port-security maximum 1 switchport port-security violation shutdown switchport port-security mac-address sticky
This sequence correctly enables port security, sets the maximum MAC addresses to 1, configures the violation mode to shutdown, and enables sticky MAC learning. The first learned MAC will be saved to the running configuration as a sticky secure MAC address.
- B
interface G0/1 switchport port-security switchport port-security maximum 1 switchport port-security violation protect switchport port-security mac-address sticky
Why wrong: This is incorrect because the violation mode is set to 'protect' instead of 'shutdown'. The protect mode drops packets from unknown MAC addresses but does not disable the port, which does not meet the requirement to shut down the port on violation.
- C
interface G0/1 switchport port-security switchport port-security maximum 2 switchport port-security violation shutdown switchport port-security mac-address sticky
Why wrong: This is incorrect because the maximum MAC addresses is set to 2 instead of 1. The requirement is to allow only one MAC address, so setting the maximum to 2 would allow two devices, violating the constraint.
- D
interface G0/1 switchport port-security switchport port-security maximum 1 switchport port-security violation shutdown switchport port-security mac-address 0000.1111.2222
Why wrong: This is incorrect because it statically configures a specific MAC address instead of using sticky learning. The requirement is to have the first learned MAC address be sticky (saved to running config), not to manually assign a MAC.
Quick Answer
The correct configuration is to enter interface G0/1 and issue the commands switchport port-security, switchport port-security maximum 1, switchport port-security violation shutdown, and switchport port-security mac-address sticky. This sequence works because enabling port security activates MAC address filtering on the port, setting the maximum to one restricts it to a single device, and the violation shutdown mode physically err-disables the interface if any other MAC attempts to communicate. The sticky keyword dynamically learns the first MAC address seen and writes it into the running configuration as a secure MAC address, effectively locking that device to the port. On the CCNA 200-301 v2 exam, this scenario tests your understanding of how sticky learning differs from static MAC entries and how violation modes behave; a common trap is forgetting that sticky must be enabled after port security is turned on, or confusing shutdown with restrict or protect. Remember the mnemonic “SMS” for the three required commands: Switchport port-security, Maximum 1, Shutdown violation, then add Sticky last.
CCNA Switching and Network Access Practice Question
This 200-301 practice question tests your understanding of switching and network access. This is a configuration task: choose the command set that satisfies every stated requirement. Small differences — like 'secret' vs 'password' or 'transport input ssh' vs 'all' — change whether the answer is correct. After answering, compare your reasoning against the explanation and wrong-answer breakdown below. Once you have made your selection, read the full explanation to reinforce the concept and understand why each distractor is designed to mislead on exam day.
You are connected to SW1 via console. SW1 is a Layer 2 switch. Port G0/1 connects to a PC that should be allowed only one MAC address. Currently, the port is configured with default settings. You need to enable port security on G0/1, set the maximum MAC addresses to 1, configure the port to shut down if a violation occurs, and ensure that the first learned MAC address is sticky (i.e., saved to the running config).
Clue words in this question
Noticing these words before you look at the options changes how you read each choice.
Clue:
"first"Why it matters: Order matters here. You are being tested on which action comes before the others — not which action is generally useful.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
interface G0/1 switchport port-security switchport port-security maximum 1 switchport port-security violation shutdown switchport port-security mac-address sticky
Enabling port security and setting maximum MAC addresses to 1 limits the port to one device. The violation shutdown mode disables the port if another MAC attempts to use it. Sticky MAC learning dynamically learns the first MAC and saves it to the running configuration.
Key principle: A trunk being up does not mean the VLAN is allowed across it. Always verify the allowed VLAN list and whether the VLAN exists on both switches.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
interface G0/1 switchport port-security switchport port-security maximum 1 switchport port-security violation shutdown switchport port-security mac-address sticky
Why this is correct
This sequence correctly enables port security, sets the maximum MAC addresses to 1, configures the violation mode to shutdown, and enables sticky MAC learning. The first learned MAC will be saved to the running configuration as a sticky secure MAC address.
Clue confirmation
The clue word "first" in the question point toward this answer.
Related concept
Access ports place end devices into a single VLAN.
- ✗
interface G0/1 switchport port-security switchport port-security maximum 1 switchport port-security violation protect switchport port-security mac-address sticky
Why it's wrong here
This is incorrect because the violation mode is set to 'protect' instead of 'shutdown'. The protect mode drops packets from unknown MAC addresses but does not disable the port, which does not meet the requirement to shut down the port on violation.
- ✗
interface G0/1 switchport port-security switchport port-security maximum 2 switchport port-security violation shutdown switchport port-security mac-address sticky
Why it's wrong here
This is incorrect because the maximum MAC addresses is set to 2 instead of 1. The requirement is to allow only one MAC address, so setting the maximum to 2 would allow two devices, violating the constraint.
- ✗
interface G0/1 switchport port-security switchport port-security maximum 1 switchport port-security violation shutdown switchport port-security mac-address 0000.1111.2222
Why it's wrong here
This is incorrect because it statically configures a specific MAC address instead of using sticky learning. The requirement is to have the first learned MAC address be sticky (saved to running config), not to manually assign a MAC.
Option-by-option analysis
Why each answer is right or wrong
Understanding why wrong answers are wrong — and when they would be correct — is what separates a 750 score from a 900. The 200-301 exam frequently reuses these exact scenarios with slightly different constraints.
✓interface G0/1 switchport port-security switchport port-security maximum 1 switchport port-security violation shutdown switchport port-security mac-address stickyCorrect answer▾
Why this is correct
This sequence correctly enables port security, sets the maximum MAC addresses to 1, configures the violation mode to shutdown, and enables sticky MAC learning. The first learned MAC will be saved to the running configuration as a sticky secure MAC address.
✗interface G0/1 switchport port-security switchport port-security maximum 1 switchport port-security violation protect switchport port-security mac-address stickyWrong answer — click to see why▾
Why this is wrong here
The violation mode 'protect' does not shut down the port; it only drops offending traffic. The question explicitly requires the port to shut down.
Why candidates choose this
Candidates may confuse the different violation modes (protect, restrict, shutdown) and might think 'protect' is sufficient because it prevents unauthorized traffic, but it does not disable the port.
✗interface G0/1 switchport port-security switchport port-security maximum 2 switchport port-security violation shutdown switchport port-security mac-address stickyWrong answer — click to see why▾
Why this is wrong here
The maximum MAC addresses must be set to 1 to restrict the port to a single device. Setting it to 2 allows an additional device.
Why candidates choose this
Candidates might mistakenly think that the default maximum is 1 or that setting it to 2 is acceptable, but the question explicitly requires a maximum of 1.
✗interface G0/1 switchport port-security switchport port-security maximum 1 switchport port-security violation shutdown switchport port-security mac-address 0000.1111.2222Wrong answer — click to see why▾
Why this is wrong here
The command 'switchport port-security mac-address 0000.1111.2222' statically assigns a MAC address, which does not allow dynamic learning. Sticky learning is enabled with the 'sticky' keyword.
Why candidates choose this
Candidates may think that manually configuring a MAC address is equivalent to sticky learning, but sticky learning dynamically learns and saves the first MAC, whereas static configuration requires manual entry and does not adapt.
Analysis generated from the official 200-301blueprint and verified against question context. The “when correct” sections are what AI assistants cite when candidates ask “what’s the difference between these options?”
Common exam traps
Common exam trap: an active trunk can still block the VLAN you need
A trunk being up does not prove every VLAN is crossing it. Check allowed VLAN lists, native VLAN mismatch, VLAN existence and access-port assignment.
Detailed technical explanation
How to think about this question
VLAN questions usually combine access-port and trunking clues. The key is to identify whether the issue is local to one switchport, caused by the trunk, or caused by the VLAN not existing where it needs to exist.
KKey Concepts to Remember
- Access ports place end devices into a single VLAN.
- Trunk ports carry multiple VLANs between switches.
- Allowed VLAN lists decide which VLANs can cross a trunk.
- Native VLAN mismatch can create confusing symptoms.
TExam Day Tips
- Use show vlan brief to verify access VLANs.
- Use show interfaces trunk to verify trunk state and allowed VLANs.
- Do not treat every same-VLAN issue as a routing problem.
Key takeaway
A trunk being up does not mean the VLAN is allowed across it. Always verify the allowed VLAN list and whether the VLAN exists on both switches.
Real-world example
How this comes up in practice
A help-desk technician troubleshoots why a newly connected PC cannot reach shared printers on the same floor. The cable is good, the switch port is active, but the PC is in VLAN 20 and the printers are in VLAN 10. The uplink trunk only allows VLAN 10. A trunk being up does not mean every VLAN crosses it.
What to study next
Got this wrong? Here's your next step.
Review VLAN allowed lists, native VLAN mismatch detection, and how to verify VLAN membership with show vlan brief and show interfaces trunk. Then practise related 200-301 questions on switching, trunking, and access-port configuration.
- →
Switching and Network Access — study guide chapter
Learn the concepts, then practise the questions
- →
Switching and Network Access practice questions
Targeted practice on this topic area only
- →
All 200-301 questions
1,819 questions across all exam domains
- →
CCNA 200-301 v2 study guide
Full concept coverage aligned to exam objectives
- →
200-301 practice test guide
How to use practice tests most effectively before exam day
Related practice questions
Related 200-301 practice-question pages
Use these pages to review the topic behind this question. This is how one missed question becomes focused revision.
Network Infrastructure and Connectivity practice questions
Practise 200-301 questions linked to Network Infrastructure and Connectivity.
Switching and Network Access practice questions
Practise 200-301 questions linked to Switching and Network Access.
IP Routing practice questions
Practise 200-301 questions linked to IP Routing.
Network Services and Security practice questions
Practise 200-301 questions linked to Network Services and Security.
AI and Network Operations practice questions
Practise 200-301 questions linked to AI and Network Operations.
CCNA subnetting practice questions
Practise IPv4 subnetting, CIDR, masks, host ranges and subnet selection.
CCNA OSPF practice questions
Practise OSPF neighbours, router IDs, metrics, areas and routing-table interpretation.
CCNA VLAN practice questions
Practise VLANs, access ports, trunks, allowed VLANs and switching scenarios.
CCNA STP practice questions
Practise spanning tree, root bridge election, port roles and STP troubleshooting.
CCNA EtherChannel practice questions
Practise LACP, PAgP, port-channel behaviour and bundle requirements.
CCNA ACL practice questions
Practise standard and extended ACLs, permit/deny logic and traffic filtering.
CCNA NAT practice questions
Practise static NAT, dynamic NAT, PAT and inside/outside address translation.
Practice this exam
Start a free 200-301 practice session
Short sessions build daily habit. Longer sessions build exam-day stamina. Try a timed session to simulate real conditions.
FAQ
Questions learners often ask
What does this 200-301 question test?
Switching and Network Access — This question tests Switching and Network Access — Access ports place end devices into a single VLAN..
What is the correct answer to this question?
The correct answer is: interface G0/1 switchport port-security switchport port-security maximum 1 switchport port-security violation shutdown switchport port-security mac-address sticky — Enabling port security and setting maximum MAC addresses to 1 limits the port to one device. The violation shutdown mode disables the port if another MAC attempts to use it. Sticky MAC learning dynamically learns the first MAC and saves it to the running configuration.
What should I do if I get this 200-301 question wrong?
Review VLAN allowed lists, native VLAN mismatch detection, and how to verify VLAN membership with show vlan brief and show interfaces trunk. Then practise related 200-301 questions on switching, trunking, and access-port configuration.
Are there clue words in this question I should notice?
Yes — watch for: "first". Order matters here. You are being tested on which action comes before the others — not which action is generally useful.
What is the key concept behind this question?
Access ports place end devices into a single VLAN.
About these practice questions
Courseiva creates original exam-style practice questions with explanations and wrong-answer analysis. It does not publish real exam questions, exam dumps, or protected exam content. Learn why practice questions differ from exam dumps →
Same concept, more angles
1 more ways this is tested on 200-301
These questions test the same concept from different angles. Work through them to make sure you can recognise it however the exam phrases it.
Variation 1. You are connected to SW1, a Layer 2 switch. Port G0/1 connects to a PC in VLAN 10. Management requires that only one MAC address is allowed on this port, and if a violation occurs, the port should shut down and a log message should be generated. Additionally, you need to ensure that the port enables rapidly and does not wait for STP convergence. Currently, the PC has MAC address aaaa.bbbb.cccc.
medium- ✓ A.switchport port-security; switchport port-security maximum 1; switchport port-security mac-address aaaa.bbbb.cccc; switchport port-security violation shutdown; spanning-tree portfast
- B.switchport port-security maximum 1; switchport port-security mac-address aaaa.bbbb.cccc; switchport port-security violation restrict; spanning-tree portfast
- C.switchport port-security maximum 1; switchport port-security mac-address aaaa.bbbb.cccc; switchport port-security violation protect; spanning-tree portfast
- D.switchport port-security maximum 1; switchport port-security mac-address aaaa.bbbb.cccc; switchport port-security violation shutdown; no spanning-tree portfast
Why A: Port security limits access to a port based on MAC addresses. The correct sequence must first enable port security with the `switchport port-security` command. Then setting maximum to 1 with a specific MAC ensures only that device can connect. Violation shutdown disables the port if an unauthorized MAC appears. PortFast allows the port to transition to forwarding immediately, which is appropriate for end-user devices. Options B and C use wrong violation modes (restrict or protect) that do not shut the port and may not log. Option D uses correct violation mode but omits PortFast, causing STP delays.
Last reviewed: Jun 7, 2026
This 200-301 practice question is part of Courseiva's free Cisco certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the 200-301 exam.
Question Discussion
Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.
Sign in to join the discussion.