LOGBOOK

HELP

Quiz Entry - updated: 2026.06.18

How do you assign a switch port to a VLAN (Virtual Local Area Network)?

Enter the interface, set it to access mode with switchport mode access, then assign it to a VLAN with switchport access vlan <id>.

Command sequence:

Switch# configure terminal
Switch(config)# interface fa0/18
Switch(config-if)# switchport mode access
Switch(config-if)# switchport access vlan 20
Switch(config-if)# end

What each command does:

  1. interface fa0/18 — select the physical port
  2. switchport mode access — set this port as an access port (single VLAN only, not a trunk). This is important — it prevents the port from negotiating trunking
  3. switchport access vlan 20 — assign this port to VLAN 20
  4. The end device on this port must have an IP (Internet Protocol) address in VLAN 20's subnet (e.g., 172.17.20.0/24)

Useful notes:

  • If the VLAN doesn't exist yet when you assign it, newer Catalyst switches will auto-create it
  • You can assign multiple ports at once using interface range fa0/1 - 12
  • Use no switchport access vlan to return a port to VLAN 1
  • Always verify with show vlan brief or show interfaces switchport

From Quiz: NETW2 / VLANs | Updated: Jun 18, 2026