×
1 Lessons
1 Lessons
2 Lessons
2 Lessons
2 Lessons
2 Lessons
1 Lessons
2 Lessons
2 Lessons
2 Lessons

VLANs and trunking

Teaches learners how to logically separate networks and carry traffic between network segments.

2 Lessons
1 Lessons
2 Lessons
2 Lessons
2 Lessons
2 Lessons
1 Lessons
2 Lessons

1. Lesson Introduction

A Virtual Local Area Network, commonly called a VLAN, is a logical network created within a physical network.

VLANs allow network administrators to divide one physical network into multiple logical networks.

For example, a school may have one physical network infrastructure containing computers, printers, access points and switches. Instead of placing every device in the same logical network, the administrator can create separate VLANs for:

  • Administration

  • Teachers

  • Students

  • ICT department

  • Guests

  • Security systems

The devices can remain connected to the same physical switches while being logically separated into different VLANs.

VLANs are therefore an important networking technology for improving network organisation, traffic management and security.

2. Learning Objectives

By the end of this lesson, the learner should be able to:

  1. Define a VLAN.

  2. Explain why VLANs are used.

  3. Explain the difference between a physical LAN and a VLAN.

  4. Describe how VLANs logically divide a network.

  5. Identify common VLAN types.

  6. Explain access ports and trunk ports.

  7. Explain VLAN tagging.

  8. Describe the purpose of VLAN IDs.

  9. Explain inter-VLAN communication.

  10. Explain the relationship between VLANs and IP subnets.

  11. Describe the security benefits of VLANs.

  12. Create a simple VLAN design.

  13. Perform basic VLAN configuration on a network switch.

  14. Troubleshoot common VLAN problems.

3. Meaning of a VLAN

VLAN stands for Virtual Local Area Network.

A VLAN is a logical grouping of devices within a switched network.

The word "virtual" means that the grouping is created through network configuration rather than by physically separating the computers and switches.

For example, one switch could have:

  • Port 1–8 assigned to VLAN 10

  • Port 9–16 assigned to VLAN 20

  • Port 17–20 assigned to VLAN 30

Although all devices are connected to the same physical switch, they belong to different logical networks.

4. Why Are VLANs Needed?

Without VLANs, all devices connected to the same basic Layer 2 network may belong to the same broadcast domain.

Consider a school with 100 computers.

If every computer is placed in one network, broadcast traffic from one part of the network can reach many other devices.

VLANs allow the administrator to divide the network.

For example:

VLAN 10 – Administration

VLAN 20 – Teachers

VLAN 30 – Students

VLAN 40 – ICT Department

VLAN 50 – Guests

This provides better organisation and allows different network policies to be applied to different groups.

5. VLANs and Broadcast Domains

One of the most important purposes of VLANs is to divide broadcast domains.

A broadcast is traffic intended for devices within a particular broadcast domain.

By default, devices in different VLANs are separated at Layer 2.

For example:

Computer A → VLAN 10

Computer B → VLAN 10

Computer C → VLAN 20

Computer D → VLAN 20

A Layer 2 broadcast from Computer A is normally received by devices in VLAN 10, but not by devices in VLAN 20.

This helps control unnecessary broadcast traffic.

6. VLAN Example

Imagine a computer laboratory with 30 computers.

The network administrator wants to create three groups:

  • Students

  • Instructors

  • Administrators

The physical network may use the same switches and cables.

The administrator can create:

VLAN 10 – Students

VLAN 20 – Instructors

VLAN 30 – Administrators

This creates logical separation without requiring three completely separate physical networks.

7. VLAN ID

Each VLAN is normally identified using a VLAN ID.

A VLAN ID is a numerical identifier assigned to a VLAN.

Examples include:

  • VLAN 10

  • VLAN 20

  • VLAN 30

  • VLAN 40

The number helps switches identify which logical network a frame belongs to.

Network administrators should use a consistent VLAN numbering plan.

For example:

VLAN IDPurpose
10Administration
20Staff
30Students
40ICT
50Guests
60CCTV

8. VLAN Names

Administrators can also assign meaningful names to VLANs.

For example:

VLAN 10 – ADMIN

VLAN 20 – STAFF

VLAN 30 – STUDENTS

VLAN 40 – ICT

VLAN 50 – GUEST

Meaningful names make network management easier.

9. VLANs and IP Subnets

VLANs are commonly associated with different IP subnets.

For example:

VLAN 10 – Administration
Network: 192.168.10.0/24

VLAN 20 – Staff
Network: 192.168.20.0/24

VLAN 30 – Students
Network: 192.168.30.0/24

This makes it easier to identify which IP network belongs to which VLAN.

A common design principle is:

One VLAN → One IP subnet

Although this is common practice, the two concepts are not exactly the same.

A VLAN is a Layer 2 logical network, while an IP subnet is a Layer 3 logical network.

10. VLANs and Network Layers

VLANs operate primarily at Layer 2 of the OSI model.

They are associated with Ethernet switching.

IP addressing and routing operate at Layer 3.

This distinction is important.

A switch can separate VLANs at Layer 2, but communication between different VLANs normally requires Layer 3 routing.

11. Access Ports

An access port is a switch port normally assigned to one VLAN.

For example:

Switch Port 1 → VLAN 10

Switch Port 2 → VLAN 10

Switch Port 3 → VLAN 20

A computer connected to an access port generally sends and receives ordinary Ethernet frames without needing to understand VLAN tagging.

Access ports are commonly used for:

  • Desktop computers

  • Printers

  • IP phones

  • Cameras

  • Other end devices

12. Trunk Ports

A trunk port is a switch port that can carry traffic for multiple VLANs.

For example, suppose two switches need to support:

  • VLAN 10

  • VLAN 20

  • VLAN 30

Instead of creating a separate physical cable for every VLAN, a trunk connection can carry traffic from all three VLANs over one physical link.

Example:

Switch A

↓ Trunk

Switch B

The trunk allows multiple VLANs to travel between switches.

13. Access Port vs Trunk Port

FeatureAccess PortTrunk Port
VLANs carriedNormally oneMultiple
Typical connectionEnd deviceSwitch-to-switch
VLAN taggingUsually handled by switchUsed to identify VLANs
ExamplePC to switchSwitch to switch
Main purposeConnect devicesCarry multiple VLANs

14. VLAN Tagging

When traffic from multiple VLANs travels over a trunk, the network needs a way to identify which VLAN each frame belongs to.

VLAN tagging provides this information.

The most common standard associated with VLAN tagging on Ethernet networks is IEEE 802.1Q.

An 802.1Q VLAN tag identifies the VLAN associated with the frame.

15. IEEE 802.1Q

IEEE 802.1Q is an important standard for VLAN tagging.

It allows VLAN information to be carried within Ethernet frames.

When a tagged frame travels across a trunk link, the receiving switch can determine which VLAN the frame belongs to.

802.1Q is widely used in switched Ethernet networks.

16. Native VLAN

On some trunk configurations, one VLAN may be designated as the native VLAN.

Frames associated with the native VLAN may be transmitted without an 802.1Q tag depending on the equipment and configuration.

Network administrators should configure native VLANs carefully because incorrect configurations can create connectivity and security problems.

17. VLAN Communication

Devices in the same VLAN can communicate at Layer 2 if other network conditions permit.

For example:

PC 1 → VLAN 10

PC 2 → VLAN 10

They can communicate within VLAN 10.

However:

PC 1 → VLAN 10

PC 2 → VLAN 20

These devices are in different Layer 2 broadcast domains.

Communication between them normally requires routing.

18. Inter-VLAN Routing

Inter-VLAN routing is the process of allowing communication between different VLANs.

For example:

VLAN 10 → Router/Layer 3 Switch → VLAN 20

A router or Layer 3 switch can route traffic between the VLANs.

19. Why Inter-VLAN Routing Is Important

Consider a company with:

VLAN 10 – Administration

VLAN 20 – Staff

VLAN 30 – Students

Administration computers may need to access a central server located in another VLAN.

Inter-VLAN routing can allow authorised communication while network security policies control which traffic is permitted.

20. Router-on-a-Stick

Router-on-a-stick is one method of performing inter-VLAN routing.

A single physical router interface can use multiple logical subinterfaces.

The connection between the switch and router operates as a trunk.

Conceptually:

VLAN 10
↓
Switch → Trunk → Router

VLAN 20
↓
Switch → Trunk → Router

The router uses different subinterfaces to route traffic between VLANs.

21. Layer 3 Switch

A Layer 3 switch can perform both switching and routing functions.

It can create switched VLANs and route traffic between VLANs.

This is useful in larger networks where routing between VLANs is required.

22. VLAN Security

VLANs can improve network security by logically separating groups of devices.

For example:

  • Guest users can be separated from staff.

  • Student computers can be separated from administration systems.

  • CCTV devices can be separated from ordinary computers.

  • Servers can be placed in dedicated network segments.

However, VLANs alone should not be treated as complete security.

Firewalls, access-control rules, authentication and other security technologies may also be required.

23. Guest VLAN

A guest VLAN can be used to provide network access to visitors without giving them direct access to internal organisational systems.

For example:

VLAN 50 – GUEST

Guest devices may be allowed to access the Internet while being prevented from reaching sensitive internal servers.

24. Management VLAN

A management VLAN can be used for managing network devices.

Network administrators may place management interfaces for switches, access points and other infrastructure into a dedicated VLAN.

Example:

VLAN 99 – MANAGEMENT

This can help separate network administration traffic from ordinary user traffic.

25. Voice VLAN

Voice VLANs are used to separate IP telephone traffic from normal data traffic.

For example:

VLAN 10 – DATA

VLAN 20 – VOICE

An IP phone can therefore use the voice VLAN while a computer connected through the phone can use the data VLAN, depending on the network design and equipment.

26. Data VLAN

A data VLAN is used for ordinary user data traffic.

Examples include:

  • Web browsing

  • File access

  • Email

  • Office applications

  • Learning systems

27. Default VLAN

Network switches commonly have a default VLAN when they are initially configured.

The exact behaviour depends on the switch manufacturer and configuration.

Administrators should understand the default VLAN and configure the network according to the organisation's security and management requirements.

28. VLAN Configuration Example

On a Cisco-style switch, a simple VLAN configuration may look like:

Switch(config)# vlan 10
Switch(config-vlan)# name ADMIN

Switch(config)# vlan 20
Switch(config-vlan)# name STAFF

Switch(config)# vlan 30
Switch(config-vlan)# name STUDENTS

A port can then be assigned to a VLAN.

Example:

Switch(config)# interface fastethernet 0/1
Switch(config-if)# switchport mode access
Switch(config-if)# switchport access vlan 10

This assigns the port to VLAN 10.

Commands vary between vendors, so learners should consult the documentation for the particular switch being used.

29. Configuring a Trunk

A simplified Cisco-style trunk configuration may look like:

Switch(config)# interface gigabitethernet 0/1
Switch(config-if)# switchport mode trunk

The trunk can then carry the VLANs permitted by the configuration.

30. VLAN Verification

Network administrators need to verify VLAN configuration.

On many Cisco switches, commands such as the following are useful:

show vlan brief

This can display VLAN information and assigned ports.

A trunk can be checked using:

show interfaces trunk

The exact commands depend on the network device.

31. VLANs Across Multiple Switches

Suppose a school has two switches.

Switch A has:

  • Students

  • Teachers

Switch B also has:

  • Students

  • Teachers

The switches can be connected using a trunk.

The trunk carries:

VLAN 10 – Students

VLAN 20 – Teachers

This allows students on both switches to remain in the same logical VLAN while teachers remain in another.

32. VLAN Example for a Computer Laboratory

Consider a training centre with:

  • 20 student computers

  • 5 instructor computers

  • 3 administrative computers

  • 2 network printers

A possible VLAN design is:

VLAN 10 – Students

VLAN 20 – Instructors

VLAN 30 – Administration

VLAN 40 – Printers

This improves organisation and makes it easier to apply different network policies.

33. VLAN Example for a Bank

A bank may separate:

VLAN 10 – Staff

VLAN 20 – Customer Service

VLAN 30 – ATMs

VLAN 40 – CCTV

VLAN 50 – Management

VLAN 60 – Guest

This can help reduce unnecessary traffic and provide logical separation between different types of systems.

34. VLAN Example for a School

A school could use:

VLAN 10 – Administration

VLAN 20 – Teachers

VLAN 30 – Students

VLAN 40 – Library

VLAN 50 – ICT Laboratory

VLAN 60 – Guest Wi-Fi

Each group can have appropriate network policies.

35. Advantages of VLANs

VLANs provide several advantages:

  1. Logical network segmentation.

  2. Reduced broadcast domains.

  3. Better network organisation.

  4. Improved traffic management.

  5. Greater flexibility.

  6. Easier user grouping.

  7. Improved security when combined with access controls.

  8. Easier network administration.

  9. Better use of existing switching infrastructure.

  10. Support for different network policies.

36. Disadvantages of VLANs

VLANs can also introduce challenges.

  1. Configuration can be complex for beginners.

  2. Incorrect configuration can cause connectivity problems.

  3. Inter-VLAN communication requires routing.

  4. Troubleshooting can be more difficult.

  5. Trunk configuration must be correct.

  6. Security must be properly configured.

  7. Larger networks may require careful VLAN documentation.

  8. Different vendors may use different configuration procedures.

37. Common VLAN Problems

Common problems include:

  • Wrong VLAN assigned to a port

  • VLAN does not exist

  • Trunk is not configured

  • Incorrect trunk configuration

  • VLAN not permitted on trunk

  • Incorrect native VLAN

  • Incorrect IP subnet

  • DHCP problems

  • Inter-VLAN routing failure

  • Firewall blocking traffic

  • Incorrect gateway configuration

38. VLAN Troubleshooting

A technician can follow these steps:

  1. Check whether the device is connected.

  2. Check the switch port.

  3. Confirm the assigned VLAN.

  4. Confirm that the VLAN exists.

  5. Check the IP address.

  6. Check the subnet mask.

  7. Check the default gateway.

  8. Check trunk configuration.

  9. Check whether the VLAN is allowed across the trunk.

  10. Test communication within the same VLAN.

  11. Test inter-VLAN communication.

  12. Check router or Layer 3 switch configuration.

39. Practical Activity 1: Create VLANs

Using a network simulator such as Cisco Packet Tracer:

Create:

  • VLAN 10 – ADMIN

  • VLAN 20 – STAFF

  • VLAN 30 – STUDENTS

Assign three switch ports to each VLAN.

Verify the configuration.

40. Practical Activity 2: Connect Two Switches

Create two switches.

Configure:

  • VLAN 10

  • VLAN 20

Assign ports on both switches to the appropriate VLANs.

Connect the switches with a trunk.

Test communication between devices in the same VLAN.

41. Practical Activity 3: Observe VLAN Isolation

Create:

PC1 – VLAN 10

PC2 – VLAN 10

PC3 – VLAN 20

Assign IP addresses appropriately.

Test communication.

Observe that devices in different VLANs require routing to communicate.

42. Practical Activity 4: Configure Inter-VLAN Routing

Using a router or Layer 3 switch:

  1. Create VLAN 10.

  2. Create VLAN 20.

  3. Assign ports.

  4. Configure a trunk.

  5. Configure Layer 3 interfaces or router subinterfaces.

  6. Assign gateway addresses.

  7. Configure PCs.

  8. Test communication between VLANs.

43. Practical Activity 5: Design a VLAN Network

Design a VLAN network for a training institution.

Create VLANs for:

  • Administration

  • Trainers

  • Students

  • ICT

  • Guests

  • Printers

For each VLAN, provide:

  • VLAN ID

  • VLAN name

  • IP subnet

  • Default gateway

  • Purpose

44. Assessment Questions

  1. What does VLAN stand for?

  2. Define a VLAN.

  3. Why are VLANs used?

  4. What is a broadcast domain?

  5. What is a VLAN ID?

  6. What is an access port?

  7. What is a trunk port?

  8. What is VLAN tagging?

  9. What is IEEE 802.1Q?

  10. Why are VLANs commonly associated with IP subnets?

  11. What is inter-VLAN routing?

  12. What is a guest VLAN?

  13. What is a management VLAN?

  14. What is a voice VLAN?

  15. State five advantages of VLANs.

  16. State four disadvantages of VLANs.

  17. What is the difference between an access port and a trunk port?

  18. Why is a Layer 3 device required for normal communication between different VLANs?

  19. What is router-on-a-stick?

  20. Give three common VLAN configuration problems.

45. Practical Assignment

Design a VLAN network for a computer training centre with:

  • 30 student computers

  • 5 instructors

  • 5 administrative computers

  • 3 network printers

  • 4 wireless access points

  • Guest users

  • CCTV cameras

Your design must include:

  1. VLAN IDs.

  2. VLAN names.

  3. IP networks.

  4. Switch ports.

  5. Trunk connections.

  6. Default gateways.

  7. Inter-VLAN routing.

  8. Security controls.

  9. Guest network isolation.

  10. A labelled network diagram.

46. Key Terms

VLAN – Virtual Local Area Network.

VLAN ID – Numerical identifier assigned to a VLAN.

Access Port – A switch port normally associated with one VLAN.

Trunk Port – A switch port that carries traffic for multiple VLANs.

VLAN Tag – Information identifying the VLAN associated with a frame.

802.1Q – IEEE standard for VLAN tagging.

Broadcast Domain – A group of devices that receive a particular Layer 2 broadcast.

Inter-VLAN Routing – Routing traffic between different VLANs.

Layer 3 Switch – A switch capable of performing routing functions.

Native VLAN – VLAN associated with untagged traffic on a trunk under applicable configurations.

Voice VLAN – VLAN used for voice/IP telephone traffic.

Guest VLAN – VLAN used to separate guest network users.

Management VLAN – VLAN used for managing network infrastructure.

47. Lesson Summary

A VLAN is a logical network created within a physical switched network.

VLANs allow network administrators to divide a network into logical groups without necessarily requiring separate physical networks.

Important VLAN concepts include:

  • VLAN IDs

  • Access ports

  • Trunk ports

  • VLAN tagging

  • IEEE 802.1Q

  • Broadcast domains

  • IP subnets

  • Inter-VLAN routing

VLANs are widely used in schools, businesses, banks, government institutions, hospitals and other organisations.

They can improve network organisation, traffic management and security when properly designed and combined with appropriate security controls.

48. Further Learning Through Senior ICT Academy

More learning will be delivered through the Senior ICT Academy Campus by either a physical instructor or an online instructor.

Learners can continue with practical VLAN configuration, trunking, inter-VLAN routing, Layer 3 switching, VLAN security and enterprise network design.

Campus: https://campus.seniorictacademy.com/login

Senior ICT Academy: https://seniorictacademy.com