Ad space (banner)
📡Networking Lessons
Lesson 17 / 39

Assigning a Port to a VLAN with switchport access vlan

When you want a port to belong to a particular VLAN group, use switchport access vlan. It assigns an access-mode port to the VLAN number you specify.

The syntax is switchport access vlan number, inside interface configuration mode — normally paired with switchport mode access.

Running switchport access vlan 10 puts the port in VLAN 10, and any device plugged into it communicates as a member of VLAN 10.

A common stumble is specifying a VLAN number that doesn't exist and wondering why traffic doesn't flow as intended. The VLAN must first be created with the vlan command.

In real work, this is an everyday task: assigning the port for a new employee's PC to their department's VLAN.

Networking
Try it (type this into the pseudo terminal)
switchport access vlan 10

🧑‍💻 You can type this command into the Networking pseudo terminal to try it yourself (this page itself has no interactive terminal).

Ad space (banner)
Ad space (in-article)