NetLabT2 L1
NetLabT2 L1
Level: 4
Faculty of Engineering
Networks Lab
Virtual LAN
Lect 1
A VLAN is a virtual LAN that allows you to segment your network without the need for physical
segmentation logically. VLANs are very flexible and can be used to provide security, flexibility, and
performance benefits. VLANs work by encapsulating Ethernet frames with a VLAN header that
contains the VLAN ID. This ID is used to identify which devices are on which VLAN.
VLANs are created by adding switch ports to a particular VLAN. Devices on the same VLAN can
communicate with each other without the need for a router. By default, all devices are assigned to
VLAN 1, known as the default VLAN.
❖ Implementing VLAN reduces CPU overhead on each device and improves host performance, by
reducing the number of devices that send broadcast frames.
❖ Implementing VLAN enhances network security. A malicious user can no longer just plug their
workstation into any switch port and sniff the network traffic using a packet sniffer.
❖ Implementing VLAN creates more flexible designs that group users by department, or by groups
that work together, instead of by physical location
Ѻ VLAN ranges:
VLAN ID: The most critical component of the VLAN tag is the VLAN Identifier (VLAN ID), a 12-bit
field. The VLAN ID is used to identify the specific VLAN to which the frame belongs. This identifier
ranges from 1 to 4095, with some IDs reserved for specific purposes.
▪ VLAN 0, 4095: These are reserved VLAN which cannot be seen or used.
▪ VLAN 1: It is the default VLAN of switches. By default, all switch ports are in VLAN. This
VLAN can’t be deleted or edit but can be used.
▪ VLAN 2-1001: This is a normal VLAN range. We can create, edit and delete these VLAN.
▪ VLAN 1002-1005: These are CISCO defaults for fddi and token rings. These VLAN can’t be
deleted.
▪ Vlan 1006-4094: This is the extended range of Vlan.
Ѻ Configuration
Can simply create VLANs by simply assigning the vlan-id and Vlan name.
#switch1(config)#vlan 2
#switch1(config-vlan)#vlan accounts
Switch(config)#int fa0/0
VLAN Configuration
Switch>enable
Switch# configure terminal
Switch(config)#vlan 10
Switch(config-vlan)#name ENG
Switch(config-vlan)# exit
Switch(config)#vlan 20
Switch(config-vlan)#name IT
Switch(config-vlan)#exit
Switch# show vlan
Ѻ The configuration
Switch>enable
Switch# configure terminal
Switch(config)#vlan 10
Switch(config-vlan)#name Chemistry_Lab
Switch(config-vlan)#exit
Switch(config)#vlan 20
Switch(config-vlan)#name Physics_Lab
Switch(config-vlan)#exit
Switch(config)#vlan 30
Switch(config-vlan)#name Biology_Lab
Switch(config-vlan)#exit
Switch(config)#exit
Switch#show vlan brief
❖ VLAN Trunking
Trunking and Frame Forwarding: Trunking, enabled by IEEE 802.1Q, allows switches to transmit
frames from multiple VLANs over a single physical link. Each frame is tagged before transmission.
On the receiving end, switches extract the VLAN tag, allowing them to direct the frame to the
appropriate VLAN or perform inter-VLAN routing.
VLAN Tagging: When a switch receives an Ethernet frame that needs to be transmitted across a trunk
link or to a device in a different VLAN, it adds the appropriate VLAN tag to the frame’s header. This
tag encapsulates the frame with the necessary VLAN information.
SW2> enable
SW2# configure terminal
SW2(config)# interface gigethernet 0/1
SW2(config-if)# switchport trunk encapsulation ?
dot1q Interface uses only 802.1q trunking encapsulation when trunking
isl Interface uses only ISL trunking encapsulation when trunking
negotiate Device will negotiate trunking encapsulation with peer on interface
Ѻ The configuration
In SW1
SW1> enable
SW1# configure terminal
SWl(config)# vlan 10
SWl(config-vlan)# exit
SWl(config)# vlan 11
SWl(config-vlan)# exit
SWl(config)# interface range f0/1 - 8
SWl(config-if)#switchport mode access
SWl(config-if)# switchport access vlan 1
SWl(config-if)# exit
SWl(config)# interface range f0/9 -16
SWl(config-if)# switchport mode access
SWl(config-if)# switchport access vlan 10
In SW2
SW2> enable
SW2# configure terminal
SW2(config)# vlan 10
SW2(config-vlan)# exit
SW2(config)# vlan 11
SW2(config-vlan)# exit