🚧 Under construction — VoTechWorks is being built. A free tech program — complimentary, as our commitment to get America working.
voTechWorksGrade 13 · a vocational technology learning center, by urbanicity
newSchoolWorks.com › VoTechWorks › Technology & Design › IT Support / Networking › Networking Fundamentals and Infrastructure › Lesson 7
TEC-ITS43-04 · Lesson 7 · 14 clock hours · lab

Switching: VLANs, Trunks, and Spanning Tree

Objective. Students will create VLANs, assign access ports, configure an 802.1Q trunk between two Cisco switches, and verify that hosts in the same VLAN communicate while hosts in different VLANs cannot reach each other without a router.

⚠ Pending professional review

This lesson, its worked examples and its practice questions has not yet been verified by an industry-certified professional or by a certification or approval body. It is a study draft and may contain errors. Do not use it as instructions for work on a job site or on live equipment. Always follow your instructor, your supervising professional, and current official references and regulations.

VoTechWorks program approval and accreditation are still in progress. Credentials are issued only by the certifying bodies named in each program, after their own exams.

What Is a VLAN?

A Virtual Local Area Network (VLAN) is a logical grouping of switch ports that behaves as if those ports were on a completely separate physical switch. Devices in the same VLAN can communicate at Layer 2 (the data-link layer) without a router. Devices in different VLANs cannot communicate unless traffic passes through a Layer 3 device such as a router or a Layer 3 switch. VLANs reduce broadcast domains, improve security, and let network administrators organize users by function rather than by physical location.

In this lab you will create VLAN 10 (Sales) and VLAN 20 (IT) on two Cisco 2960 switches. Each VLAN will have two access ports per switch, giving you four hosts total across the two switches.

Access Ports vs. Trunk Ports

An access port carries traffic for exactly one VLAN. The switch strips the VLAN tag before forwarding frames to the end device, so the PC never sees a tag. You assign an access port with:

```

interface FastEthernet0/1

switchport mode access

switchport access vlan 10

```

A trunk port carries traffic for multiple VLANs simultaneously over a single link. The 802.1Q standard defines how switches insert a 4-byte tag into each Ethernet frame to identify its VLAN. When two switches are connected to each other, that uplink is almost always configured as a trunk so that every VLAN can pass between them. You configure an 802.1Q trunk with:

```

interface GigabitEthernet0/1

switchport mode trunk

```

After issuing `show interfaces trunk` you will see which VLANs are allowed and active on the trunk. After issuing `show vlan brief` you will see which ports belong to each VLAN on the local switch.

Why Hosts in Different VLANs Cannot Ping Each Other

Switch forwarding is a Layer 2 operation based on MAC addresses. A frame from a host in VLAN 10 will only be forwarded to other ports in VLAN 10. The switch has no mechanism to move a frame from one VLAN to another. That is intentional: VLANs create security boundaries. To allow inter-VLAN communication you need a router (or a Layer 3 switch with an SVI) — a topic covered in a later lesson. In today's lab, cross-VLAN pings are expected to fail, and that failure is proof your VLANs are working correctly.

Spanning Tree Protocol (STP)

Ethernet has no built-in TTL mechanism at Layer 2. If you connect two switches with two cables and no loop-prevention mechanism exists, a single broadcast frame will circulate forever, consuming all bandwidth in what is called a broadcast storm. This can crash an entire network segment within seconds.

Spanning Tree Protocol (STP), standardized as IEEE 802.1D, prevents Layer 2 loops automatically. Every switch running STP participates in an election to choose a root bridge — the switch with the lowest Bridge ID (priority + MAC address). Once the root bridge is elected, every other switch determines the shortest path back to the root. STP then places any redundant ports into a blocking state so that only one active path exists at any time.

Port roles in STP:

You will observe these roles live using `show spanning-tree` when your instructor adds a redundant cable to create a deliberate loop.

Safety and Lab Conduct

Verification Commands Reference

| Command | What it shows |

|---|---|

| `show vlan brief` | All VLANs and their assigned ports on this switch |

| `show interfaces trunk` | Trunk ports, allowed VLANs, and active VLANs |

| `show spanning-tree` | Root bridge, port roles, port states |

| `show interfaces status` | Port speed, duplex, VLAN membership at a glance |

Record the exact output of `show vlan brief` and `show interfaces trunk` in your lab log. Your instructor will verify reachability by pinging between all four PCs; same-VLAN pings must succeed and cross-VLAN pings must fail.

Key terms8

VLAN (Virtual Local Area Network)A logical grouping of switch ports that forms a separate broadcast domain, isolating traffic at Layer 2 without requiring physical separation.
Access portA switch port configured to carry traffic for a single VLAN; the switch removes the VLAN tag before delivering frames to the connected end device.
Trunk portA switch port configured to carry traffic for multiple VLANs simultaneously using 802.1Q tagging on a single physical link, typically used for switch-to-switch uplinks.
802.1QThe IEEE standard that defines how a 4-byte VLAN tag is inserted into an Ethernet frame so that trunk links can identify which VLAN each frame belongs to.
Spanning Tree Protocol (STP)An IEEE 802.1D protocol that prevents Layer 2 loops in switched networks by electing a root bridge and blocking redundant paths, allowing them to become active only if the primary path fails.
Root bridgeThe switch elected by STP as the logical center of the spanning tree; the switch with the lowest Bridge ID (priority value combined with MAC address) wins the election.
Broadcast stormA network failure caused by a Layer 2 loop in which broadcast frames circulate endlessly, consuming all available bandwidth and preventing normal communication.
Alternate portAn STP port role assigned to a redundant path that is placed in the blocking state to prevent a loop; it transitions to forwarding if the active path fails.
In class: Guided lab: students follow a topology diagram (two Cisco switches, four PCs) to create VLAN 10 (Sales) and VLAN 20 (IT), assign two access ports per VLAN on each switch, and configure the uplink as an 802.1Q trunk using 'switchport mode trunk' · Verification exercise: students ping between hosts in the same VLAN (expected: success) and between VLANs (expected: failure); results are recorded in the lab log with the exact output of 'show vlan brief' and 'show interfaces trunk' · Spanning Tree observation: instructor induces a Layer 2 loop with a redundant cable while students observe 'show spanning-tree' output; students document port roles (root, designated, alternate) and discuss how STP prevents broadcast storms
Materials: Cisco 2960 switches (at least two per group), Ethernet patch cables, lab PCs, console cables, PuTTY, spanning-tree reference handout, lab log notebooks, CompTIA Network+ and Cisco CCNA study guides
Check: Instructor tests ping reachability between all four PCs; same-VLAN pings must succeed and cross-VLAN pings must fail; lab log must include 'show vlan brief' and 'show interfaces trunk' output; 100% of reachability results must be correct

Practice check8

Answer each question, then check it. Nothing is recorded; this is your own practice.

CompTIA Network+ — Network Infrastructure / VLANs
1. A host in VLAN 10 sends a ping to a host in VLAN 20. Both hosts are connected to the same Cisco 2960 switch. What will happen if no router or Layer 3 device is present?
Cisco CCNA — LAN Switching / VLAN Configuration
2. Which command assigns an access port to VLAN 10 on a Cisco switch?
Cisco CCNA — LAN Switching / Trunk Verification
3. A network technician runs 'show interfaces trunk' and sees that VLAN 20 does not appear in the 'VLANs allowed and active in management domain' column. Which is the most likely cause?
CompTIA Network+ — Network Infrastructure / Spanning Tree
4. During the spanning tree observation activity, a student adds a second cable between the two switches. Before STP converges, what risk does this create?
Cisco CCST — Networking Concepts / Spanning Tree
5. On a non-root bridge, which STP port role describes the port that provides the best path toward the root bridge?
Cisco CCNA — LAN Switching / Trunk Negotiation
6. A student configures 'switchport mode trunk' on the uplink port of Switch 1 but forgets to configure Switch 2. Switch 2's uplink remains in its default dynamic-auto state on a 2960. What is the most likely outcome?
CompTIA Network+ — Network Standards / VLANs
7. Which IEEE standard defines 802.1Q VLAN tagging?
Cisco CCST — Networking Concepts / VLAN Defaults
8. After completing the lab, a student's 'show vlan brief' output shows that ports Fa0/3 and Fa0/4 are listed under VLAN 1 even though they should be in VLAN 20. The student never issued a 'switchport access vlan' command on those ports. What is the correct explanation?
Record this lesson on my transcript. Sign in with your key and enrollment email to record lessons (enroll free if you have no key). This page stays open to read and practise.