Courseiva
Infrastructure →easyMultiple Choice

350-401 Infrastructure Practice Question

A network administrator is configuring a new Cisco IOS switch. The administrator needs to assign switch port GigabitEthernet0/1 to VLAN 20 and ensure that the port is in access mode. Which command sequence is correct?

⚠ Common exam trap

The trap here is thinking that assigning a VLAN automatically sets the port to access mode, or confusing access and trunk configuration commands.

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 GigabitEthernet0/1; switchport mode access; switchport access vlan 20

To assign a switch port to a VLAN and set it as an access port, the correct commands are 'switchport mode access' followed by 'switchport access vlan 20'. This ensures the port operates in access mode and carries traffic for VLAN 20. The other options either configure trunking or dynamic negotiation, which do not meet the access mode requirement.

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 GigabitEthernet0/1; switchport mode access; switchport access vlan 20

    Why this is correct

    This sequence enters interface configuration mode, sets the port to access mode, and assigns it to VLAN 20. The 'switchport mode access' command forces the port to operate as an access port, and 'switchport access vlan 20' associates it with VLAN 20. This is the standard method to configure an access port on a Cisco switch.

  • ✗

    interface GigabitEthernet0/1; switchport mode trunk; switchport trunk allowed vlan 20

    Why it's wrong here

    This sequence configures the port as a trunk and allows VLAN 20 on the trunk. While it does associate VLAN 20 with the port, it does not set the port to access mode. The requirement explicitly states that the port must be in access mode, so this configuration is incorrect for the scenario.

  • ✗

    interface GigabitEthernet0/1; switchport mode dynamic auto; switchport access vlan 20

    Why it's wrong here

    This sets the port to dynamic auto mode, which allows it to negotiate trunking if the other end initiates it. This does not guarantee access mode; the port could become a trunk. The requirement is for access mode, so this configuration is incorrect.

  • ✗

    interface GigabitEthernet0/1; switchport access vlan 20; switchport mode access

    Why it's wrong here

    The order of commands is reversed. While the end result might be the same if both commands are applied, the correct and recommended order is to set the mode first, then assign the VLAN. However, in Cisco IOS, the order does not strictly matter, but the typical sequence is mode then VLAN. This option is less clear but not necessarily wrong; however, the first option is the standard and unambiguous answer.

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

This 350-401 question is part of Courseiva's 1,923-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written and reviewed by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

Last reviewed September 2026 · checked against the official Cisco exam blueprint

This 350-401 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 350-401 exam.