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.
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.
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.
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.
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.
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.
| 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.
Answer each question, then check it. Nothing is recorded; this is your own practice.
A free tech program — complimentary, as our commitment to get America working. Help us build VoTechWorks. Tell us what works, what doesn’t, and what you want to learn.