Courseiva
Switching and Network AccessmediumMultiple ChoiceObjective-mapped

CCNA Switching and Network Access Practice Question

A switch interface connects to a user PC and should belong only to VLAN 30. Which command assigns that VLAN after the interface is in access mode?

⚠ Common exam trap

Be careful not to confuse commands for trunk ports with those for access ports. Ensure you understand the difference between setting a port mode and assigning a VLAN.

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

switchport access vlan 30

After an interface is placed into access mode, the command used to assign its VLAN is `switchport access vlan 30`. In plain language, this tells the switch which VLAN the endpoint traffic on that access port belongs to. Access mode defines the role of the interface, and the access VLAN command defines the specific VLAN membership for that role. This distinction matters because some commands change the port’s behavior while others set the VLAN it uses. The correct answer is the one that directly assigns VLAN 30 to the access port rather than modifying a trunk or a native VLAN setting.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • switchport access vlan 30

    Why this is correct

    This is the correct command to place an interface into VLAN 30 as an access port. When configured on a switchport that is set to access mode, it assigns that single VLAN to the port, allowing the user PC to communicate with other devices in VLAN 30 while isolating it from other VLANs. This is the standard method for connecting end devices like PCs, printers, and IP phones to a switch.

  • switchport trunk allowed vlan 30

    Why it's wrong here

    This command is valid only on a switchport configured as a trunk, where it restricts which VLANs are permitted to traverse the trunk link. A port connected to a user PC must be an access port, not a trunk, and the VLAN assignment for an access port is done with 'switchport access vlan'. Thus, using 'switchport trunk allowed vlan 30' would be incorrect because it does not set the access VLAN and assumes trunking is enabled.

    When this WOULD be correct

    In a scenario where the question asks how to configure a trunk port to allow only VLAN 30 traffic while excluding other VLANs, this command would be appropriate. For example, if the question specifies that the interface is in trunk mode and requires VLAN filtering, this command would be correct.

  • encapsulation dot1Q 30

    Why it's wrong here

    The encapsulation dot1Q command is typically used on a router's subinterface to define the VLAN tag for 802.1Q trunking and enable inter-VLAN routing, not on a switch access port. Switch interfaces do not require encapsulation configuration; instead, they use switchport commands to assign VLANs. Therefore, this option is incorrect because it is a router command for subinterfaces and has no effect on a standard switchport connecting to a PC.

    When this WOULD be correct

    In a different exam scenario where the question asks about configuring a trunk interface to support multiple VLANs, 'encapsulation dot1Q 30' would be correct if the question specified that the trunk should allow VLAN 30 using 802.1Q encapsulation.

  • ip helper-address 30

    Why it's wrong here

    The ip helper-address command is used to forward DHCP broadcast packets to a DHCP server located on a different subnet; it does not assign a VLAN to an interface. Additionally, this command expects a valid IP address as its parameter, not a VLAN number like 30. Therefore, it is completely unrelated to configuring an access interface for a user PC.

    When this WOULD be correct

    In a question asking for the configuration of a router to enable DHCP relay for clients on VLAN 30, where the router needs to forward requests to a DHCP server with the address '30', this command would be appropriate.

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.

switchport access vlan 30Correct answer

Why this is correct

This is the correct command to place an interface into VLAN 30 as an access port. When configured on a switchport that is set to access mode, it assigns that single VLAN to the port, allowing the user PC to communicate with other devices in VLAN 30 while isolating it from other VLANs. This is the standard method for connecting end devices like PCs, printers, and IP phones to a switch.

switchport trunk allowed vlan 30Wrong answer — click to see why

Why this is wrong here

The command 'switchport trunk allowed vlan 30' is used on trunk ports to specify which VLANs are allowed to traverse the trunk link. It does not assign a VLAN to an access port; instead, it filters VLANs on a trunk, which is not appropriate for a port connected to a single PC.

★ When this WOULD be the correct answer

In a scenario where the question asks how to configure a trunk port to allow only VLAN 30 traffic while excluding other VLANs, this command would be appropriate. For example, if the question specifies that the interface is in trunk mode and requires VLAN filtering, this command would be correct.

Why candidates choose this

A student might confuse the concept of allowing VLANs on a trunk with assigning a VLAN to an access port, especially if they are familiar with trunk configuration but not clear on the distinction between access and trunk modes.

encapsulation dot1Q 30Wrong answer — click to see why

Why this is wrong here

The command 'encapsulation dot1Q 30' is used on a router subinterface to enable 802.1Q trunking and specify the VLAN for that subinterface. It is not a valid command on a switch access port, and switch ports do not use encapsulation commands for VLAN assignment.

★ When this WOULD be the correct answer

In a different exam scenario where the question asks about configuring a trunk interface to support multiple VLANs, 'encapsulation dot1Q 30' would be correct if the question specified that the trunk should allow VLAN 30 using 802.1Q encapsulation.

Why candidates choose this

Students might associate 'dot1Q' with VLANs and think that specifying a VLAN number with this command would assign the VLAN to the port, not realizing that encapsulation is for trunking and not for access port configuration.

ip helper-address 30Wrong answer — click to see why

Why this is wrong here

The command 'ip helper-address 30' is used to configure DHCP relay on a router or Layer 3 switch interface, forwarding DHCP broadcasts to a DHCP server. It has nothing to do with VLAN assignment on a switch port.

★ When this WOULD be the correct answer

In a question asking for the configuration of a router to enable DHCP relay for clients on VLAN 30, where the router needs to forward requests to a DHCP server with the address '30', this command would be appropriate.

Why candidates choose this

A student might mistakenly think that 'helper-address' is related to VLAN assignment because both involve IP addressing and VLANs, but this command serves a completely different purpose in DHCP relay.

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?”

Visual reference

Switch VLAN 10 Sales (192.168.10.0/24) PC-A PC-B VLAN 20 HR (192.168.20.0/24) PC-C PC-D Router VLANs isolate traffic — inter-VLAN routing requires a Layer 3 device

About these practice questions

Courseiva writes every 200-301 question from scratch — 1,389 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

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.