VLANs and access ports
A VLAN is a separate broadcast domain inside one physical switch. Access ports belong to one VLAN and carry untagged traffic for the connected host. This chapter teaches access-port configuration and verification.
What you'll learn
- Create and name VLANs in the VLAN database.
- Assign an access port to a VLAN and verify with show vlan brief.
- Explain the default behaviour of unassigned switch ports.
Why VLANs exist
By default every port on a switch belongs to VLAN 1. A broadcast frame received on any port floods to every other port. VLANs let you split that single broadcast domain into many — Sales in VLAN 10, Engineering in VLAN 20, Voice in VLAN 200 — even though they share the same physical switch.
Hosts in different VLANs cannot reach each other directly. Inter-VLAN traffic must pass through a router (or an L3 switch with SVIs).
Each VLAN is one broadcast domain, and in a working design each VLAN is also exactly one IP subnet. Keep that pairing in mind: most VLAN faults turn out to be a port in the wrong VLAN, a VLAN that does not exist, or a subnet that does not match its VLAN.
Configuring an access port
Two steps: create the VLAN in the switch's VLAN database and name it, then place each port in it. switchport mode access fixes the port's role; switchport access vlan 10 chooses its VLAN. show vlan brief confirms the result.
Switch> enable
Switch# configure terminal
Switch(config)# vlan 10
Switch(config-vlan)# name SALES
Switch(config-vlan)# exit
Switch(config)# interface Fa0/1
Switch(config-if)# switchport mode access
Switch(config-if)# switchport access vlan 10
Switch(config-if)# end
Switch# show vlan brief10 more sections in this chapter, plus a 4-question quiz and a hands-on lab.
Modules 2–8 are part of the Course & Lab Pass and All-Access Max — start with a free account
You can see the title, summary, learning objectives and the opening sections. The rest of this chapter, like all of modules 2–8, comes with the Course & Lab Pass and All-Access Max. A free account opens Module 1: How Networks Work end-to-end and saves your labs — start there, no card required.
- Read every chapter in Module 1 — How Networks Work
- Save labs of up to 5 devices
- Save up to 3 topologies
- See the full course syllabus + chapter titles
Free account · no card required · compare plans any time
Build it step by step
- Two departments, one switchSplit a single switch into Sales and Ops with VLANs, and watch the pings between them stop. · 7 steps · ~15 min · 5 devices
- One VLAN across two switchesSplit four PCs into two VLANs across two switches, then carry both VLANs between the switches over a single tagged trunk. · 7 steps · ~18 min · 6 devices
- Router on a stickSplit one switch into two VLANs and route between them over a single router port. · 8 steps · ~18 min · 4 devices
- Route between VLANs on the switchGive one switch an SVI in each VLAN, find out why the VLANs still can't talk, then turn on ip routing — inter-VLAN routing with no router at all. · 6 steps · ~15 min · 3 devices
- Fix it: Fix the VLAN that stops at the trunkEngineering's server is unreachable and the south desk is cut off completely. Find the wrong VLAN and the trunk that drops it. · 6 steps · ~15 min · 5 devices
- Fix it: Fix the branch that fails four waysA branch depot has lost head office, and two of its hosts have faults of their own. Find all four, one layer at a time. · 10 steps · ~30 min · 7 devices
- Campus capstonePut it all together: two wiring closets, two VLANs, DHCP for the desks, and one public address for the whole site. · 9 steps · ~35 min · 8 devices
- Branch office capstoneStaff and guests on one switch: guests lease an address the moment they plug in, reach the internet, and never see a staff file. · 10 steps · ~40 min · 7 devices