Itnet02 Module 03 Vlans
Itnet02 Module 03 Vlans
Virtual LANs
ITNET02
▪ Explain how a switch forwards frames based on VLAN configuration in a multi-switch environment.
Module References:
▪ CCNAv7 SRWE – Modules 3.1, 3.2
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 2
3.1 Overview of VLANs
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 3
Overview of VLANs
Traditional LANs
Separate Broadcast
▪ In traditional switched LANs, the physical
Domains
topology is closely related to the logical
topology.
• e.g. hosts connected through contiguous
switches belong to the same subnet
▪ Generally, workstations must be grouped by
their physical proximity to a switch.
▪ To communicate among LANs, each
segment must have a separate port on the
backbone device or a connection to a
common backbone.
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 4
Overview of VLANs
Traditional LANs
How to implement:
Requirements: - 3 hubs / switches per floor
- Different department on each floor. - 1 router per floor with 4
- Three different LANs per floor. ports each
- Separate networks -10 Broadcast domains
- Inefficient traffic flow
Ex₱ensive!
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 5
Overview of VLANs
VLAN Definitions
Separate Broadcast
▪ A VLAN is a logical partition of a Layer 2 network.
Domains
• The partitioning of the Layer 2 network takes place inside a
Layer 2 device, usually via a switch.
• Each VLAN is an independent network that can span
multiple physical LAN segments.
▪ Placing devices into various VLANs have the following
characteristics:
• Allows segmentation of the various groups of devices on the
same switches
• Improves network manageability and performance for
organizations
• Broadcasts, multicasts and unicasts are isolated in the
individual VLAN
• Each VLAN is will have its own unique range of IP
addressing
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 6
Overview of VLANs
Benefits of a VLAN Design
Benefits of using VLANs are as follows:
Benefits Description
Smaller Broadcast Dividing the LAN reduces the size of broadcast domains
Domains
Improved Security Only users in the same VLAN can communicate together
Improved IT Efficiency VLANs can group devices with similar requirements, e.g. faculty vs.
students regardless of their physical location
Reduced Cost One switch can support multiple groups or VLANs
Better Performance Small broadcast domains reduce traffic, improving bandwidth
Simpler Management Similar groups will need similar applications and other network resources
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 7
Overview of VLANs
Benefits of a VLAN Design
With VLANs:
- 1 switch per floor
- 1 Router for the entire LAN
- 3 Broadcast Domains
- Efficient traffic flow
- More scalable
- Easier to manage
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 8
Overview of VLANs
Types of VLANs
Default VLAN
VLAN Name Status Ports
VLAN 1 is the following: ---- -------------------------------- --------- -------------------------------
1 default active Fa0/1, Fa0/2, Fa0/3, Fa0/4
• The default VLAN Fa0/5, Fa0/6, Fa0/7, Fa0/8
Fa0/9, Fa0/10, Fa0/11, Fa0/12
• The default Native VLAN Fa0/13, Fa0/14, Fa0/15, Fa0/16
Fa0/17, Fa0/18, Fa0/19, Fa0/20
Fa0/21, Fa0/22, Fa0/23, Fa0/24
• The default Management Gig0/1, Gig0/2
1002 fddi-default active
VLAN 1003 token-ring-default active
1004 fddinet-default active
• Cannot be deleted or 1005 trnet-default active
renamed
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 9
Overview of VLANs
Types of VLANs (Cont.)
Data VLAN
• Dedicated to user-generated traffic (email and web traffic).
• Commonly created for specific groups of users or devices
Native VLAN
• This is used for trunk links only.
• All frames are tagged on an 802.1Q trunk link except for those on the native VLAN. (More on this later)
• Commonly used for backwards compatibility with older networking devices
Management VLAN
• This is used for accessing the administrative interfaces of network infrastructure devices
• Commonly used for SSH/Telnet VTY traffic and should not be carried with end user traffic for security
reasons.
• Typically, the SVI (VLAN interface) of a Layer 2 switch is assigned to this VLAN.
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 10
Overview of VLANs
Types of VLANs (Cont.)
Voice VLAN
• A separate VLAN created for exclusively
carrying voice traffic to cater to its unique
requirements
• Voice traffic requires:
• Assured bandwidth
• High QoS priority
• Ability to avoid congestion
• Delay less that 150 ms from source to
destination
• The entire network must be designed to
support voice.
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 11
3.2 VLAN Implementation
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 12
VLAN Configuration
VLAN Ranges on Catalyst Switches
▪ VLANs are split into two categories:
• Normal range VLANs
• VLAN numbers from 1 to 1,005
• Configurations saved in the vlan.dat (in the flash memory)
• IDs 1002 through 1005 are reserved for legacy Token Ring
and Fiber Distributed Data Interface (FDDI) VLANs,
automatically created and cannot be removed.
• Can be synchronized across multiple switches using VTP
(to be discussed next time)
• Extended Range VLANs
• VLAN numbers from 1,006 to 4,096
• Configurations saved in running / startup configuration (NVRAM)
• Supports fewer VLAN features
• Commonly used by service providers or large organizations
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 13
VLAN Configuration
Creating a VLAN
Task IOS Command
Enter global configuration mode. Switch# configure terminal
Create a VLAN with a valid ID number. Switch(config)# vlan vlan-id
Specify a unique name to identify the VLAN. (Optional) Switch(config-vlan)# name vlan-name
Return to global config mode Switch(config-vlan)#exit
S1(config)# vlan 20
S1(config-vlan)# name student
S1(config-vlan)# exit
S1#
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 14
VLAN Configuration
Assigning Ports to VLANs
Task Command
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 15
VLAN Configuration
Quick VLAN Configuration
▪ To configure multiple VLANs, a series of VLAN IDs can be entered separated by commas,
or a range of VLAN IDs separated by hyphens.
• vlan 100,102,105-107
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 17
VLAN Configuration
The Management VLAN and Switch SVIs
▪ It is common practice to create a management VLAN exclusively for membership of network infrastructure devices
such as routers, switches and firewalls through which their administrative interfaces can be accessed
▪ To avoid unauthorized access to network device management facilities, regular users are normally not assigned to
the management VLAN
▪ To set up a management VLAN and assign the switch as a member, create a VLAN for management then enable
and assign an IP address to the SVI with an interface ID that matches the management VLAN ID
Task Command
Create a VLAN for management with a valid ID number. Switch(config)# vlan vlan-id
▪ Note: For the switch VLAN interface to be active, there needs to be hosts, such as a network administrator’s
workstation, connected to ports assigned to the management VLAN
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 18
VLAN Configuration
Assigning Switch Management Interfaces to VLANs
To set up a management VLAN and assign the switch as a member, create a VLAN for management then
enable and assign an IP address to the SVI with an interface ID that matches the management VLAN ID
Task Command
Create a VLAN for management with a valid ID number. Switch(config)# vlan vlan-id
S1(config)# vlan 10
S1(config-vlan)# name management
S1(config-vlan)# interface vlan 10
S1(config-if)# ip address 192.168.10.2 255.255.255.0
S1(config-if)# no shutdown
S1(config-if)# interface Fa0/24
S1(config-if)# switchport mode access
S1(config-if)# switchport access vlan 10
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 19
VLAN Assignment
Verifying VLAN Configurations
▪ show vlan or show vlan brief – Displays the list of VLANs on the switch with the ports assigned to
them.
S1#show vlan brief
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 20
VLAN Assignment
Verifying VLAN Configurations
▪ show interface interface-id switchport - Displays the data and voice VLAN membership of a port
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 21
VLAN Assignment
Verifying VLAN Configurations
▪ show interface interface-id - Displays the configurations and status of the switch SVI.
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 22
VLAN Configuration
Delete VLANs
Delete VLANs with the no vlan vlan-id command.
Caution: Before deleting a VLAN, reassign all member ports to a different VLAN.
• Delete all VLANs with the delete flash:vlan.dat or delete vlan.dat commands (even if you did not
save the rest of your configurations)
Note: To restore to factory default – unplug all data cables, erase the startup-configuration and delete
the vlan.dat file, then reload the device.
S1# erase startup-config
Erasing the nvram filesystem will remove all configuration files! Continue? [confirm]
[OK]
Erase of nvram: complete
%SYS-7-NV_BLOCK_INIT: Initialized the geometry of nvram
S1#delete vlan.dat
Delete filename [vlan.dat]?
Delete flash:/vlan.dat? [confirm]
S1#reload
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 23
3.3 VLANs in a
Multi-Switched Environment
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 24
VLANs in a Multi-Switched Environment
Defining VLAN Trunks
• The concept of trunking began with the
telephone industry.
• Multiple calls were moved between
customers and central offices or
between the offices themselves over a
single physical connection.
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 25
VLANs in a Multi-Switched Environment
Defining VLAN Trunks
No trunk
Trunk
▪ A trunk is a physical and logical connection between two switches across which network
traffic travels.
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 26
VLANs in a Multi-Switched Environment
Defining VLAN Trunks
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 27
VLANs in a Multi-Switched Environment
Networks without VLANs
▪ Without VLANs, all devices connected to the switches will receive all unicast, multicast, and broadcast
traffic.
▪ Broadcasts can easily consume the network’s capacity because the network is one broadcast domain.
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 28
VLANs in a Multi-Switched Environment
Networks with VLANs
▪ With VLANs, unicast, multicast, and broadcast traffic is confined to a VLAN, controlling the reach of
broadcast frames and their impact in the network.
▪ Without a Layer 3 device to connect the VLANs, devices in different VLANs cannot communicate.
How do you ensure that the data frames of each VLAN still arrive at the
correct VLAN after they pass through the trunks?
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 29
VLANs in a Multi-Switched Environment
VLAN Identification with a Tag
• IEEE 802.1Q is a protocol used to define how
Ethernet frames will be carried across switch trunks
in a network using VLANs
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 31
VLANs in a Multi-Switched Environment
Voice VLAN Tagging
The VoIP phone is a three port
switch:
• The switch will use CDP to inform
the phone of the Voice VLAN.
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 32
3.4 VLAN Trunk Implementation
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 33
VLAN Trunks
Trunk Configuration Commands
Configure and verify VLAN trunks. Trunks are layer 2 and carry traffic for all VLANs.
Task IOS Command
Set the port to permanent trunking mode. Switch(config-if)# switchport mode trunk
Notes:
▪ Ports on switches of both ends of the trunk connection must be configured with the same native VLAN and
allowed VLAN settings.
▪ A VLAN must be created on a switch before its traffic can cross the trunk links
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 34
VLAN Trunks
Trunk Configuration Example
The subnets associated with each VLAN are:
• VLAN 10 - Faculty/Staff - 172.17.10.0/24
• VLAN 20 - Students - 172.17.20.0/24
• VLAN 30 - Guests - 172.17.30.0/24
• VLAN 99 - Native - 172.17.99.0/24
F0/1 ports on S1 and S2 will serve as the trunk link
S1(config-vlan)# interface Fa0/1
S1(config-if)# switchport mode trunk
S1(config-if)# switchport trunk native vlan 99
S1(config-if)# switchport trunk allowed vlan 10,20,30,99
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 37
VLAN Trunks
Reset the Trunk to the Default State
• Reset the default trunk settings with the no command.
• All VLANs allowed to pass traffic
• Native VLAN = VLAN 1
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 38
Questions?
Module Summary
What did you learn in this module?
• VLANs are based on logical instead of physical connections and can segment
networks based on function, team, or application.
• Each VLAN is considered a separate logical network.
• A separate voice VLAN is required to support VoIP.
• Normal range VLAN configurations are stored in the vlan.dat file in flash.
• An access port can belong to one data VLAN at a time, but may also have a
Voice VLAN.
• A trunk is a point-to-point link that carries traffic from multiple VLAN across a
dingle connection.
• Frames are tagged as they are carried across trunk links. VLAN tag fields
include the type, user priority, CFI and VID.
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 40