240493131014 Computer Networks
Practical: 5
SNPIT/CSE/2025-26/SEM-5/3150710 Page | 71
240493131014 Computer Networks
Practical: - 5
Aim: - Implement the concept of VLAN using Network Simulator.
➢ What is VLAN?
- VLAN is the abbreviation for Virtual LAN, i.e. Virtual Local Area Network.
- This is a custom network we create from one or more existing LANs.
- It enables a group of devices from multiple networks (both wired and wireless) to be
combined into a single Logical network.
- The result is a VLAN that can be administered like a physical area network.
- The network equipment like routers or switches must support the VLAN configurations
to create a VLAN.
• Advantages of VLAN:
o Security: VLANs come up with extra security because users of the same group
can send broadcast messages with an assurance that users from another group will
not receive that broadcast message.
o Time and Cost Reduction: It can reduce the migration cost of stations because
it is a lot easier and quicker to migrate using the software.
- Let us create a network in Cisco Packet Tracer and configure VLAN in it.
- Here we create 2 LANs with 6 hosts each of them and in each LAN, we create 2
VLANs and try to communicate between them.
• Step 1:
- At first, we create a LAN, LAN-A with 6 hosts.
- To create a LAN, we need one Layer 2 switch Switch0 and 6 end devices.
- Now we provide IP addresses to the hosts starting from [Link] (you can provide
any valid IP addresses).
- To provide an IP address to a host just select that host → Desktop → IP Configuration
→ IPv4 Addresses and provide an IP address and then ENTER, the Subnet Mask will
be provided by default.
Fig: 5.1 Assigning IP Address
SNPIT/CSE/2025-26/SEM-5/3150710 Page | 72
240493131014 Computer Networks
• Step 2:
- Let us create 2 VLANs where the name of the first VLAN is VLAN-STUDENT and
the second VLAN is VLAN-FACULTY.
- To configure VLANs we have to go to the switch Switch0 and move to Config →
SWITCHING → VLAN Database.
- Now let us take the VLAN Number for STUDENT is 150 and for FACULTY is 250
and add these numbers to VLAN Database.
Fig: 5.2 VLAN Configuration
• Step 3:
- Next, we have to select the hosts under VLAN-STUDENT. Here I have put hosts with
IP addresses from [Link] to [Link] under VLAN-STUDENT.
- To do so we have to select the switch Switch0 → Config → INTERFACE, here we
choose FastEthernet0/1 corresponding to the host [Link] which we consider to
be in VLAN-STUDENT.
- Now we select the down arrow beside VLAN and select 150: STUDENT, which is for
student VLAN.
- Similarly, we do this same process for FastEthernet0/2 and FastEthernet0/3.
SNPIT/CSE/2025-26/SEM-5/3150710 Page | 73
240493131014 Computer Networks
Fig: 5.3 Configuring to PC’s
• Step 4:
- Now we have to configure the hosts under VLAN-FACULTY. Here I have put hosts
with IP addresses [Link] to [Link] under VLAN-FACULTY.
- To do so, just follow the process mentioned in Step 3, but instead of selecting the VLAN
Number 150: STUDENT, select 250: FACULTY for FastEthernet0/4, FastEthernet0/5,
and FastEthernet0/6.
SNPIT/CSE/2025-26/SEM-5/3150710 Page | 74
240493131014 Computer Networks
Fig: 5.4 Configuring to PC’s
• Step 5:
- Lastly, just change the switch port mode from Access to Trunk for FastEthernet0/7.
Fig: 5.5 Configuring to PC’s
SNPIT/CSE/2025-26/SEM-5/3150710 Page | 75
240493131014 Computer Networks
- You can create LAN-B similarly by following these steps and connect LAN-A and
LAN-B by using a Cross-Over cable. And your end network will look like this:
Fig: 5.6 VLAN’s
- Now our VLAN configuration is ready, and we can check this by sending data packets
from one host to another under LAN-A.
- Let us ping from [Link] to [Link].
- To do so, we have to select the host with IP [Link] and then select Desktop →
Command Prompt.
- Now run the following command to ping [Link].
- You can get the Request timed out at first but don't worry, if you followed all the steps
mentioned properly then run the command again to ping, and it'll do the job.
Fig: 5.7 Student to Student (Same VLAN)
- Now, let us try to ping from LAN-A VLAN-STUDENT to LAN-B VLAN-STUDENT.
SNPIT/CSE/2025-26/SEM-5/3150710 Page | 76
240493131014 Computer Networks
- Let us ping [Link] of LAN-A VLAN-STUDENT to [Link] of LAN-B
VLAN-STUDENT.
Fig: 5.8 Student to Student (Different VLAN)
- You can also ping the hosts under VLAN-FACULTY by following the previous steps,
but you cannot ping from a host under VLAN-STUDENT to a host under VLAN-
FACULTY or vice versa.
- It'll generate a request time out because your created Virtual LAN STUDENT doesn't
contain any host with IP addresses from [Link] to [Link].
- Similarly, VLAN-FACULTY also doesn't contain IP addresses from [Link] to
[Link].
- To ping again, run the command in the command prompt of the host with IP
[Link]
Fig: 5.9 Faculty to Faculty (Same VLAN)
- Now, let us try to ping from LAN-A VLAN-FACULTY to LAN-B VLAN-FACULTY.
- Let us ping [Link] of LAN-A VLAN-FACULTY to [Link] of LAN-B
VLAN-FACULTY.
SNPIT/CSE/2025-26/SEM-5/3150710 Page | 77
240493131014 Computer Networks
Fig: 5.10 Faculty to Faculty (Different VLAN)
- As you can see that we're getting replies from the VLAN-FACULTY host of LAN-A.
- Now, when a student PC (in VLAN-Student) tries to send a packet (e.g., ping) to a
faculty PC (in VLAN-Faculty), the request does not succeed.
Fig: 5.11 Student to Faculty
SNPIT/CSE/2025-26/SEM-5/3150710 Page | 78