Difficulty: Easy
Correct Answer: switch(config-if)#switchport access vlan 3
Explanation:
Introduction / Context:
This question tests your knowledge of basic VLAN configuration on a Cisco Catalyst 2950 switch. Assigning switch ports to the correct VLANs is one of the most fundamental tasks for a network administrator and appears frequently in Cisco certification exams and real environments.
Given Data / Assumptions:
- The device is a Cisco Catalyst 2950 layer 2 switch.
- We want to assign a specific physical port (for example, FastEthernet0/3) to VLAN 3.
- The port should operate as a standard access port for end devices like PCs or printers.
- The question asks which exact interface configuration command completes this assignment.
Concept / Approach:
On Cisco Catalyst switches, you configure a port as an access port and then specify the VLAN it belongs to. This is done in interface configuration mode, not in global configuration mode or privileged EXEC mode. The correct sequence is to enter interface configuration for the desired port, optionally set switchport mode access, and then use switchport access vlan <vlan-number> to place the port into the correct VLAN. The actual VLAN must exist in the VLAN database or be created beforehand for full connectivity.
Step-by-Step Solution:
Step 1: From privileged EXEC mode, enter global configuration using configure terminal.Step 2: Enter interface configuration mode for the desired port, for example interface fastethernet0/3.Step 3: Optionally specify switchport mode access to force the port to operate as an access port rather than negotiate trunking.Step 4: Use the command switchport access vlan 3 to assign the port to VLAN 3.Step 5: Verify the configuration with show vlan brief or show interfaces switchport.
Verification / Alternative check:
In a lab, after configuring switchport access vlan 3 on FastEthernet0/3, show vlan brief will list VLAN 3 and show that Fa0/3 is a member of that VLAN. A connected host receiving an IP in the appropriate subnet will then communicate with other devices in VLAN 3 but not with other VLANs unless inter-VLAN routing is in place. This confirms that the interface command successfully assigns the port to VLAN 3 as an access port.
Why Other Options Are Wrong:
Option A, switchport vlan 3, is not valid syntax; the correct keyword is switchport access vlan. Option B is entered from privileged EXEC mode, not interface configuration mode, so it is syntactically incorrect. Option C tries to use switchport access vlan from global configuration mode, which is not allowed; it must be under a specific interface. Option E combines trunk mode with a VLAN, which relates to allowed VLANs on a trunk, not assigning an access port to a single VLAN.
Common Pitfalls:
Many beginners forget to enter interface configuration mode and attempt to type switchport commands at the wrong level. Another common mistake is confusing switchport mode access with switchport access vlan; the first defines the port type, the second defines the VLAN membership. Remembering the exact syntax and context helps avoid configuration errors and saves troubleshooting time.
Final Answer:
The correct command is switch(config-if)#switchport access vlan 3, entered under the configuration of port FastEthernet0/3.
Discussion & Comments