Hiring Partners
Segilola Resources Operating LimitedTaviatech TechnologiesFCMBMTN NigeriaAdvans La Fayette Microfinance BankAboki AfricaFirst Bank of NigeriaOPay
← Networking Basics Level Two · Lesson 2 of 7

Module One

📖 Every lesson in this course is free to read right here, no account needed. Create a free account to track your progress, take the exam, and earn your certificate.
2
Level 2 · Module 2 · Switching & VLANs · 13‑year‑old edition

Module 2: Switching & VLANs

age 13+ Level 2 🔀 divide and organise your network

In Level One, you learned that a switch sends data only to the right device. Now it's time to level up: what if one switch could serve many separate mini-networks at once — like separate group chats inside one big class? That's the magic of VLANs. Let's dive in! 🚀

1. How a switch thinks (the MAC address table)

A switch is like a smart post office. It keeps a list — the MAC address table — that maps each device's unique MAC address to the physical port it's plugged into. When data arrives, the switch looks up the destination MAC and sends it out the right door. 🚪

Example MAC address table

MAC address Port Device
AA:BB:CC:11:22:33 Port 1 Laptop
DD:EE:FF:44:55:66 Port 2 Printer
11:22:33:AA:BB:CC Port 3 Smart TV

At first the table is empty. The switch learns by watching where packets come from. It's called MAC learning. 🧠

2. VLANs — splitting one switch into many

Analogy: the school

Imagine one big school building (the switch). Without VLANs, everyone hears everything — chaos. With VLANs, each classroom is separate: only students in the same class talk to each other. 🏫

Analogy: group chats

One big group chat would be a mess. Instead, we make separate groups — Family, Gaming Squad, School Project. Each is a VLAN! 💬

Why bother?

VLANs add security (guests can't reach your files), less noise (fewer broadcast storms), and flexibility (move a device without rewiring). 🎯

3. A real VLAN layout

One switch · three VLANs

A single physical switch can be divided into several logical networks. Here's a common setup:

VLAN 10 · Staff

Teachers' laptops and office devices. Tightly controlled.

VLAN 20 · Students

Student devices. Can access the internet, but not staff files.

VLAN 30 · Guests

Visitors. Internet only — no access to any internal resources.

Because each VLAN is its own little network, traffic can't cross between them unless a router allows it. That's isolation! 🔒

4. Access ports vs trunk ports

Access port

one VLAN only
  • Belongs to a single VLAN.
  • Used for end devices: laptops, printers, phones.
  • When a device plugs in, it's automatically in that VLAN — no tagging needed.
  • Like a single classroom door — you can only enter one room. 🚪

Trunk port

many VLANs at once
  • Carries traffic for multiple VLANs.
  • Used between switches or from switch → router.
  • Packets are tagged with a VLAN ID so the receiver knows which VLAN they belong to.
  • Like a highway with multiple lanes — each lane is a different VLAN. 🛣️
5. 802.1Q — how trunk ports tag packets

When a frame travels over a trunk, the switch adds a tiny 4‑byte tag (called an 802.1Q tag) that says which VLAN it belongs to. Without it, the receiving switch wouldn't know where to forward it.


Ethernet frame

802.1Q tag
(VLAN ID)

Type

Payload data
Fun fact: The 802.1Q tag is only 4 bytes long — tiny compared to a full packet (which can be up to 1,500 bytes). But those 4 bytes are what makes VLANs work across multiple switches. 🏷️
6. Inter‑VLAN routing — letting VLANs talk

Router‑on‑a‑stick

By default, VLANs can't talk to each other. That's good for security — but sometimes they need to share data. The trick? A router with a single cable connected to a trunk port on the switch. The router has a sub-interface for each VLAN, like a little doorway for each one. 🚪🚪🚪

Device in VLAN 10
Switch (trunk port)
Router (sub-interfaces)
Device in VLAN 20

Why "on a stick"? Because it looks like the router is skewered on a single cable — one physical link, but multiple logical interfaces. 🍢

7. Peek at the config (what it looks like)
Example switch CLI (Cisco-style)
Switch> enable
Switch# configure terminal
Switch(config)# vlan 10
Switch(config-vlan)# name STAFF
Switch(config-vlan)# exit
Switch(config)# vlan 20
Switch(config-vlan)# name STUDENTS
Switch(config-vlan)# exit
! Assign an access port to VLAN 10
Switch(config)# interface FastEthernet0/1
Switch(config-if)# switchport mode access
Switch(config-if)# switchport access vlan 10
! Configure a trunk port
Switch(config)# interface GigabitEthernet0/1
Switch(config-if)# switchport mode trunk

Don't worry if this looks scary — it's just telling the switch which ports belong to which VLAN. You'll practice this in Packet Tracer! 🖥️

Hands‑on lab: in Packet Tracer, create 3 VLANs (10/20/30), assign PCs to each, and connect two switches with a trunk. Can PCs in the same VLAN ping each other? Can PCs in different VLANs? 🧪
LAB TIME

You just learned: MAC address tables, what VLANs are & why they're useful, access vs trunk ports, 802.1Q tagging, and router‑on‑a‑stick inter‑VLAN routing.

🏆 Get Certified

🔒

Earn this certificate

Every lesson is already free to read. Sign up, finish the lessons, pass the exam (₦2,000 or 20,000 coins), and get a verified certificate with your name on it.

🎓 Sign Up to Get Certified
🛠️ Practice Tools
Hands-on simulators & labs - subscription required.
→
🎯 Internship Tasks
Real-world tasks to build your portfolio - unlock them with a subscription.
→