Bangladesh Army University of Science and Technology (BAUST), Saidpur
Department of Computer Science and Engineering (CSE)
LAB REPORT
Course Code: CSE 3206
Course Title: Computer Networks Sessional
Report No: 08
Report Tittle: Implementation and Configuration of VLANs in a Local Area Network
Using Cisco Packet Tracer
Comment:
1
1. Objectives
1. To understand the concept and purpose of VLANs (Virtual Local Area Networks) in networking
2. To learn how to segment a physical network into multiple logical networks for better
organization and security.
3. To configure VLANs on switches and assign ports to the appropriate VLANs using Cisco
Packet Tracer.
2. Introduction
A Virtual Local Area Network (VLAN) allows network administrators to divide a single physical
network into multiple logical networks. VLANs improve network efficiency, security, and
management by grouping devices based on function, department, or other criteria, rather than
physical location. By assigning switch ports to different VLANs, devices in the same VLAN can
communicate directly, while communication between VLANs requires a router or Layer 3 device.
This lab demonstrates how to create, configure, and test VLANs using Cisco Packet Tracer, helping
to understand the practical applications of VLANs in real-world network environments.
3. Required Hardware and Software:
Hardware: Personal Computer/Laptop
Software:Cisco Packet Tracer version 8.2
4. Procedure
1. Open Cisco Packet Tracer: Launch Cisco Packet Tracer and create the network
topology with three switches, a router, and multiple PCs as shown in the diagram.
2. Connect Devices:
a. Connect PCs to their respective switch ports.
b. Connect switches to each other using trunk links.
c. Connect the router to the first switch using a FastEthernet link (e.g., Fa0/0).
3. Create VLANs on Switches:
a. Open the CLI of each switch and create the required VLANs. Based on the
diagram: VLAN 2, VLAN 3, VLAN 4, VLAN 5.
Example for Switch0:
Switch> enable
Switch# configure terminal
Switch(config)# vlan 2
Switch(config-vlan)# name VLAN2
Switch(config-vlan)# exit
Switch(config)# vlan 3
Switch(config-vlan)# name VLAN3
Switch(config-vlan)# exit
Switch(config)# vlan 4
Switch(config-vlan)# name VLAN4
Switch(config-vlan)# exit
Switch(config)# vlan 5
Switch(config-vlan)# name VLAN5
2
Switch(config-vlan)# exit
4. Assign VLANs to Access Ports:
a. Assign switch ports to the appropriate VLANs according to the diagram.
Example for Switch0:
Switch(config)# interface fa0/1
Switch(config-if)# switchport mode access
Switch(config-if)# switchport access vlan 3
Switch(config-if)# exit
Switch(config)# interface fa0/2
Switch(config-if)# switchport mode access
Switch(config-if)# switchport access vlan 3
Switch(config-if)# exit
Switch(config)# interface fa0/3
Switch(config-if)# switchport mode access
Switch(config-if)# switchport access vlan 4
Switch(config-if)# exit
Switch(config)# interface fa0/4
Switch(config-if)# switchport mode access
Switch(config-if)# switchport access vlan 2
Switch(config-if)# exit
Repeat similar steps for Switch1 and Switch2 according to the VLAN
assignments in the diagram.
5. Configure Trunk Ports Between Switches:
Configure the uplink ports connecting switches as trunk ports to allow multiple VLAN
traffic to pass.
Example for Switch0:
Switch(config)# interface fa0/24
Switch(config-if)# switchport mode trunk
Switch(config-if)# exit
6. Configure Router for Inter-VLAN Routing (Router-on-a-Stick):
On the router, create sub-interfaces for each VLAN and assign the corresponding IP
addresses as default gateways.
3
Example:
Router> enable
Router# configure terminal
Router(config)# interface fa0/0.2
Router(config-subif)# encapsulation dot1Q 2
Router(config-subif)# ip address [Link] [Link]
Router(config-subif)# exit
Router(config)# interface fa0/0.3
Router(config-subif)# encapsulation dot1Q 3
Router(config-subif)# ip address [Link] [Link]
Router(config-subif)# exit
7. Repeat for VLAN 4 and VLAN 5.
8. Verify Connectivity:
Use the ping command to test:
a) PCs within the same VLAN should communicate successfully.
b) PCs in different VLANs should communicate if inter-VLAN routing is configured.
5. Example Implementation:
Figure 01 :- Virtual Local Area Networks
4
Verify Connectivity:
5
6. Discussion & Conclusion:
In this lab, we implemented and configured VLANs in a Local Area Network using Cisco Packet
Tracer. VLANs allow logical segmentation of a network, improving efficiency, security, and
management. By assigning different devices to separate VLANs, we could control broadcast
domains, reduce network congestion, and isolate traffic between departments or user groups.
During the configuration process, we observed that proper VLAN assignment and trunking between
switches are critical for successful communication. Devices within the same VLAN were able to
communicate seamlessly, while inter-VLAN communication required a router or Layer 3 device.
The lab also highlighted the importance of configuring switch ports correctly (access or trunk) to
ensure VLAN traffic flows as intended.