Understanding VLANs: Types and Setup
Understanding VLANs: Types and Setup
VLAN
Virtual LAN
Plan
Definition and necessity of VLAN
Types of VLAN: Static and dynamic
Vlan Data, …
Native VLAN
Creation of VLAN
Designation of ports for a VLAN
Need for a VLAN
Definition and necessity
LAN => includes all the
equipment in a
same broadcast Domain.
Flexibility
Flexibility to group users by department, by
working groups,...instead of separating them
physically each by a switcher.
Ease of fault diagnosis,
Limit of STP on the VLAN of the same switch.
Type of VLAN
Static: create manually (based on @MAC)
•Dynamically: by a server (based on the
@MAC, port number, ...
VLAN ranking:
classic traffic
Voice: VoIP,..
…
Type of vlan
Several types of VLAN are defined, based on the switching criterion and the level.
auquel il s'effectue :
Level 1 VLAN (also called Port-Based VLAN) defines
a virtual network based on the connection ports on the switch;
The VLAN by protocol (in English Protocol-Based VLAN) allows for the creation of a
virtual network by protocol type (for example TCP/IP, IPX, AppleTalk, etc.)
thus regrouping all the machines using the same protocol within a
same network
Creation of VLAN (in a static way)
Or: Sw#vlan database
•Sw(config)#vlan (vlan-id) Sw(vlan)#vlan (vlan-id) name (NAME)
•Sw(config-vlan)#name (give a name to your vlan)
•Sw(config)#int fa0/1 (assign the port fa0/1 to the vlan id)
or well
•Sw(config)#int range fa0/1-12 (allocate a set of ports to a VLAN ID)
Sw(config-if)#switchport mode access
•Sw(config-if)#switchport access vlan (vlan id)
Id: Identifier of a VLAN, value ranging from 1 to 1005 for standard VLANs.
Native Vlan; by default, if you do not create any VLANs, the switch(es) you are
connected will create a default VLAN with identifier 1: (VLAN001)
The VLAN identifiers that you can create (delete) range from: 2 .. 100
There are specific valves (id: 1002, ..1005) that are reserved for communication with others.
types of LAN (fiber optic, FrameRelay, FDDI,...)
Port type in vlan (access port for the end user)
Example of valn (two valns, vlan20 and valn30
Switch#show vlan
•Switch#show vlan
Assignment of ports to vlan20
Switch(config)#int fa0/1
Switch(config-if)#switchport mode access
Switch(config-if)#switchport access vlan 20
Trunk mode interface
Ping between the same devices of the same VLAN on the same switch: OK,
Ping between the same devices in the same VLAN but on different switches: Failed
Problem: the link between the two switchers cannot ensure switching within a
same value on different switchers
Trunk mode interface
Solution: configure the interfaces connecting the two switches in Trunk mode.
In CLI, type:
Router(config-if)#no ip address
Router(config-if)#exit
Router(config)#interface fastEthernet 0/0.10
Creation of an interface
Router(config-subif)#encapsulation dot1Q 10 virtual for valn 10
Router(config-subif)#ip add [Link] [Link]
Router(config-subif)#no shutdown (→ no shutdown)
Router(config-subif)#exit
Do the same for all the interfaces needed for the different VLANs created.
2thstep: assign the Gateway to
level of the different PCs of each VLAN
Go to each of the PCs and add the gateways.
All PCs in the same VLAN must have the same
gateway.
3thstep: trunk mode of the interface
switch - Router
Change the mode of the port connecting the switch to the
router, from access mode to trunk mode.
Routing table: Router#show ip route
example for three VLANs: 10, 20, and 30
Concept of trunk
When a frame from a neighboring switch arrives at our switch, how does it know to
Which VLAN does the received frame belong to?
If nothing is done, the switch will assume that the frame belongs to VLAN 1 configured on the
port (default VLAN 1).
It is therefore necessary to configure the switches so that each time a frame exits a port for
join another switch, we add the identifier of the VLAN to which the frame belongs.
It's the concept of Trunk!
During its spread
on multiple switches, The trunk is the mechanism that
each frame will keep allows to insert the identifier
the information of his of VLAN on a user frame.
belonging to one's
VLAN.
The destination switch
will know through which ports it
plot can to be
switched (ports
belonging to the same
VLAN.
Concept of trunk
All the frames that will come out at this link (right or left switch) will be visible.
apply an additional label that contains the VLAN identifier (in black)
the framework).
Historically, Cisco had created its own Trunk protocol between its switches.
named ISL –Inter-Switch Link. But this feature required an inter-
interoperability with other manufacturers.
The Trunk 802.1Q standard was released and Cisco also implemented it in its switches. Hence
possibility on some Cisco switches to decide which trunk we want to use, ISL or
802.1Q.
Port Trunk ISL
The proprietary Cisco ISL trunk has the characteristic of encapsulating the entire user frame in
a new frame, called ISL frame. Here is what an ISL frame looks like:
Note: a frame that arrives unencapsulated ISL on a trunk port (coming from a user)
not belonging to a VLAN), will be classified as belonging to the Native VLAN (which is
by default the same as VLAN1).
Port Trunk 802.1Q
The standardized trunk 802.1Q does not encapsulate the entire user frame like ISL but
cut the frame and insert a tag or TAG, named TAG 802.1Q.
Here is what a user frame looks like with the addition of the TAG 802.1Q:
40
The first framework is that of the user who arrives on the switch. As soon as this
the frame is sent to a port configured in Trunk 802.1Q, the switch inserts the TAG label
(frame n°2 in the diagram).
Port Trunk 802.1Q
The content of this TAG includes the following fields (frame no. 3 in the diagram):
The trunk port 802.1Q places unidentified traffic on the native VLAN, which is by default the
VLAN 1 on a Cisco switch.
PVID: Port Vlan ID (meaning which VLAN ID this port is assigned to?)
When configuring a 802.1Q trunk port, its PVID is assigned the ID identifier.
the native VLAN. In other words: each port configured as a trunk will be allocated, by default,
to the native VLAN.
All untagged traffic entering or exiting a trunk port is switched based on the
PVID value.
For example, if VLAN 77 is configured as the native VLAN, the PVID will be 77 and all the
unmarked traffic is transferred to VLAN 77.
It is recommended to configure the native VLAN as a VLAN distinct from VLAN 1 and
other VLANs. In fact, it is advisable to dedicate a fixed VLAN to serve as the native VLAN.
for all Trunk ports in the LAN.
Native Vlan
PC1 and PC2 are in VLAN 10.
PC3 and PC4 are in VLAN 20.
The traffic of the two VLANs passes through.
the Trunk link that is
configured between the two
switches.
This VLAN interface will be the Switch Virtual Interface (SVI) allowing to
to administer.
If the native VLAN is the same as the management VLAN, there is a security risk.
The native VLAN, when used, and the management VLAN must always be one.
distinct VLAN number from any other VLAN.
Voice VLANs
VoIP traffic requires:
Guaranteed bandwidth to ensure the
quality of the voice
Transmission priority over
other types of network traffic.
Possibility of routing around the areas
clogged with the network.
Voice VLAN is necessary
•Delay less than 150 ms on the network
to take care of the voice
To meet these requirements,
the entire network must be designed over IP (VoIP).
to support VoIP.
voice VLAN between a
switch, a phone
In this figure, VLAN 150 is designed
to route voice traffic. Cisco IP and a computer.
The student's computer PC5 is
connected to the Cisco IP phone and the
The phone is connected to the switch.
S3.
Show the information of a single VLAN (using its ID, e.g. VLAN 20): S1#show vlan id 20
Show information of a single VLAN (using its name): S1#show vlan name L2CS
Creation of a VLAN when assigning an interface to a non-existent VLAN (e.g.: the VLAN
40 does not exist on S1) : S1(config-if)#switchport access vlan 40
% Access VLAN does not exist. Creating vlan40
Note
Decommissioning an interface from a VLAN ID:
S1(config-if)# no switchport access vlan id