DCCN - Lab 4-A VLAN

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 6

IQRA UNIVERSITY GULSHAN CAMPUS

Department of Computer Science

DATA COMMUNICATION AND COMPUTER NETWORKS

LAB EXPERIMENT # 4-A

VLANs (Virtual LANs)

OBJECTIVE:

 This lab assignment helps in understanding how VLANs (Virtual LAN) can be
created on a single Cisco switch.
THEORY:
VLAN a short for virtual LAN, a network of computers that behave as if they are connected to
the same wire even though they may actually be physically located on different segments of a
LAN.

VLANs are configured through software rather than hardware, because VLANs are based on
logical instead of physical connections, which make them extremely flexible.

Why VLANs?

If you want for example to separate the different departments of your enterprise into different IP
sub networks, A group of devices on a LAN that are configured (using management software) so
that they can communicate as if they were attached to the same wire, (VLANs) within the same
switch, supporting traffic isolation between logically different networks.

Ports of VLANs

The Ports are actually the communication points on the switch, by default all the ports on the
switch are known as switching ports.

On a Cisco switch, ports are assigned to a single VLAN. These ports are referred to as access
ports and provide a connection for end users or node devices, such as a router or server. By
default all devices are assigned to VLAN 1, known as the default VLAN. After creating a
VLAN, you can manually assign a port to that VLAN and it will be able to communicate only
with or through other devices in the VLAN.

1- Access Port

An "access port" is a type of connection on a switch that is used to connect a guest virtual
machine that is VLAN unaware. This port provides the virtual machine with connectivity
through a switch that is VLAN aware without requiring it to support VLAN tagging.
2- Trunk Port

A "trunk port" is a type of connection on a switch that is used to connect a guest virtual machine
that is VLAN aware. Generally, all frames that flow through this port are VLAN tagged. The
exception to this is when a trunk port is granted access to the untagged VLAN set (native VLAN
ID).

PROCEDURE AND OBSERVATION:

Switch>en
Switch#config t

(Create and Naming VLANs)


Switch(config)#vlan 2
Switch(config-vlan)#name HR
Switch(config-vlan)#exit
Switch(config)#vlan 3
Switch(config-vlan)#name Finance
Switch(config-vlan)#exit

(Assigning ports for VLAN2)


Switch(config)#interface FastEthernet 0/1
Switch(config-if)#Switchport mode access
Switch(config-if)#Switchport access vlan 2
Switch(config-if)#exit
Switch(config)#interface FastEthernet 0/2
Switch(config-if)#Switchport mode access
Switch(config-if)#Switchport access vlan 2
Switch(config-if)#exit

OR
(Assigning ports in range)
Switch(config)#interface range FastEthernet 0/1-2
Switch(config-if)#Switchport mode access
Switch(config-if)#Switchport access vlan 2
Switch(config-if)#exit

(Assigning ports for VLAN3)


Switch(config)#interface range FastEthernet 0/3-4
Switch(config-if)#Switchport mode access
Switch(config-if)#Switchport access vlan 3
Switch(config-if)#exit

(Show VLAN configuration)


Switch# show vlan brief (Command from Privileged EXEC mode)

OR
Switch(config)#do sh vlan brief (Command from Global Config Mode)

VLAN Name Status Ports


----------------------------------------------------------------------
1 default active Fa0/5, Fa0/6, Fa0/7, Fa0/8
Fa0/9, Fa0/10, Fa0/11, Fa0/12
Fa0/13, Fa0/14, Fa0/15, Fa0/16
Fa0/17, Fa0/18, Fa0/19, Fa0/20
Fa0/21, Fa0/22, Fa0/23, Fa0/24
2 HR active Fa0/1, Fa0/2
3 Finance active Fa0/3, Fa0/4
1002 fddi-default active
1003 token-ring-default active
1004 fddinet-default active
1005 trnet-default active

Let’s check the VLANs functionality by pinging the PC’s, remember PC0 and PC1 are in VLAN2 and
PC2 and PC3 are in VLAN3. PC’s of VLAN 2 and VLAN 3 are not pinging each other, so both are in
separate VLANs.

C:\>ping 10.0.100.2 (ping from PC0 to PC1)


Pinging 10.0.100.2 with 32 bytes of data:

Reply from 10.0.100.2: bytes=32 time=1ms TTL=128


Reply from 10.0.100.2: bytes=32 time=0ms TTL=128
Reply from 10.0.100.2: bytes=32 time=0ms TTL=128
Reply from 10.0.100.2: bytes=32 time=0ms TTL=128

Ping statistics for 10.0.100.2:


Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 1ms, Average = 0ms
C:\>ping 10.0.0.3 (ping from PC0 to PC2)
PC>ping 10.0.100.3

Pinging 10.0.100.3 with 32 bytes of data:

Request timed out.


Request timed out.
Request timed out.
Request timed out.

Ping statistics for 10.0.100.3:


Packets: Sent = 4, Received = 0, Lost = 4 (100% loss),

Now, in this case only the PCs which are connected with Switch port 1
& 2 can communicate with other and can’t be able to send data traffic
on other VLANs. Likewise, the PCs which are connected with Switch port
3 & 4 can communicate with each other only.

QUESTION:

1. Take 1 switch and apply the following configuration, show network topology and
configuration in your lab task.

a. Switch with VLAN name Management & Executive having 3


logical ports each.
b. Choose network IP from Class B for LAN like 172.16.X.X
for hosts to test your LAN network.
c. Test and verify connectivity within both VLAN’s by PING
command.
Teacher Signature: ________________________

Student Registration No: ________________________

You might also like