Device Configuration Lecture 4
Device Configuration Lecture 4
◘Overview of VLANs
◘VLANs in a Multi-Switched Environment
◘VLAN Configuration
◘VLAN Trunks
◘Dynamic Trunking Protocol
2
Overview of VLANs ♣ VLANs are logical connections with other
VLAN Definitions similar devices.
♣ Placing devices into various VLANs have
the following characteristics:
▫ Provides segmentation of the various
groups of devices on the same switches
▫ Provide organization that is more
manageable
▫ Broadcasts, multicasts and unicasts are
isolated in the individual VLAN
▫ Each VLAN will have its own unique
range of IP addressing
▫ Smaller broadcast domains
3
Benefits of a VLAN Design
Benefits Description
Smaller Broadcast Dividing the LAN reduces the number of broadcast domains
Domains
Improved Security Only users in the same VLAN can communicate together
Improved IT VLANs can group devices with similar requirements, e.g. faculty vs.
Efficiency students
Reduced Cost One switch can support multiple groups or VLANs
Better Performance Small broadcast domains reduce traffic, improving bandwidth
Simpler Similar groups will need similar applications and other network
Management resources
4
Overview of VLANs
Types of VLANs
Default VLAN
VLAN 1 is the following:
◘ The default VLAN
◘ The default Native VLAN
◘ The default Management VLAN
◘ Cannot be deleted or renamed
5
Types of VLANs ….
Data VLAN
• Dedicated to user-generated traffic (email and web traffic).
• VLAN 1 is the default data VLAN because all interfaces are assigned to this VLAN.
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.
Management VLAN
• Used for SSH/Telnet VTY traffic and should not be carried with end user traffic.
• Typically, the VLAN that is the SVI(switch virtual interface) for the Layer 2 switch.
6
Types of VLANs …
Voice VLAN
◘ A separate VLAN is required because
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.
7
VLANs in a Multi-Switched Environment
Defining VLAN Trunks
◘A trunk is a point-to-point link Trunk Line
between two network devices.
◘Cisco trunk functions:
◙ Allow more than one VLAN
◙ Extend the VLAN across the
entire network
◙ By default, supports all VLANs
◙ Supports 802.1Q Trunking
8
VLANs in a Multi-Switched Environment
Networks without / with VLANs
With VLANs, unicast, multicast, and broadcast
Without VLANs, all devices connected to traffic is confined to a VLAN.
the switches will receive all unicast,
multicast, and broadcast traffic. Without a Layer 3 device to connect the VLANs,
devices in different VLANs cannot communicate.
9
VLAN Identification with a Tag
• The IEEE 802.1Q header is 4 Bytes
• When the tag is created the FCS must be
recalculated.
• When sent to end devices, this tag must be
removed and the FCS recalculated back to its
original number.
802.1Q VLAN Tag Field Function
Type • 2-Byte field with hexadecimal 0x8100
• This is referred to as Tag Protocol ID (TPID)
User Priority • 3-bit value that supports
Canonical Format Identifier (CFI) • 1-bit value that can support token ring frames on Ethernet
VLAN ID (VID) • 12-bit VLAN identifier that can support up to 4096 VLANs
10
Native VLANs and 802.1Q Tagging
◘ 802.1Q trunk basics:
►Tagging is typically done on all VLANs.
►The use of a native VLAN was designed
for legacy use, like the hub in the
example.
►Unlesschanged, VLAN1 is the native
VLAN.
►Both ends of a trunk link must be
configured with the same native VLAN.
►Each trunk is configured separately, so it
is possible to have a different native
VLANs on separate trunks.
11
Voice VLAN Tagging
The VoIP phone is a three port switch:
The switch will use CDP to inform the phone of
the Voice VLAN.
The phone will tag its own traffic (Voice) and can
set Cost of Service (CoS).
CoS is QoS for layer 2.
The phone may or may not tag frames from the
PC.
12
VLAN Configuration
VLAN Ranges on Catalyst Switches
13
VLAN Configuration…
VLAN Creation Commands
VLAN details are stored in the vlan.dat file and create VLANs in the
global configuration mode.
Task IOS Command
15
VLAN Configuration…
Data and Voice VLAN Example
Configuring of VLAN
16
VLAN Trunks
Trunk Configuration Commands
◘ Configure and verify VLAN trunks. Trunks are layer 2 and carry traffic for all VLANs.
17
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
Prompt Command
F0/1 port on S1 is configured as a
trunk port. S1(config)# Interface fa0/1
• This assumes a 2960 switch S1(config-if)# Switchport mode trunk
using 802.1q tagging.
• Layer 3 switches require the S1(config-if)# Switchport trunk native vlan 99
encapsulation to be configured S1(config-if)# Switchport trunk allowed vlan 10,20,30,99
before the trunk mode.
S1(config-if)# end
18
Verify Trunk Configuration
Set the trunk mode and native vlan. Default dynamic
Notice show int fa0/1 switchport auto
command:
◘ Is set to trunk administratively
◘ Is set as trunk operationally
(functioning)
◘ Encapsulation is dot1q
◘ Native VLAN set to VLAN 99
◘ All VLANs created on the
switch will pass traffic on this
trunk
19
Dynamic Trunking Protocol (DTP)
Introduction to DTP
Dynamic Trunking Protocol (DTP) is a proprietary Cisco protocol.
20
Dynamic Trunking Protocol…
Negotiated Interface Modes
The switchport mode command has additional options.
22
Troubleshooting VLANs and Trunks
Addressing Issues with VLAN
It is very common practice to associate a VLAN with a IP network
Since different IP networks only communicate through a router, all devices within a VLAN
must be part of the same IP network in order to communicate
In the picture below, PC1 can’t communicate to the server because it has a wrong IP address
configured
23
Troubleshooting VLANs and Trunks
Missing VLANs
If all IP addresses mismatch have been solved but device still can’t
connect, check if the VLAN exists in the switch
24
Troubleshooting VLANs and Trunks
Introduction to Troubleshooting Trunks
25
Troubleshooting VLANs and Trunks
Common Problems With Trunks
Trunking issues are usually associated with incorrect configurations.
The most common type of trunk configuration errors are:
• Native VLAN mismatches
• Trunk mode mismatches
• Allowed VLANs on trunks
If a trunk problem is detected, the best practice guidelines recommend to
troubleshoot in the order shown above.
26
Troubleshooting VLANs and Trunks
Trunk Mode Mismatches
If a port on a trunk link is configured with a trunk mode that is incompatible with
the neighboring trunk port, a trunk link fails to form between the two switches
Check the status of the trunk ports on the switches using the show interfaces
trunk command
To fix the problem, configure the interfaces with proper trunk modes.
27
Troubleshooting VLANs and Trunks
Incorrect VLAN List
VLANs must be allowed in the trunk before their frames can be transmitted
across the link
Use the switchport trunk allowed vlan id command to specify which VLANs are
allowed in a trunk link
To ensure the correct VLANs are permitted in a trunk, used the show interfaces
trunk command
28
Attacks on VLANs
Switch spoofing Attack
There are a number of different types of VLAN attacks in modern switched networks.
By configuring a host to act as a switch and form a trunk, an attacker could gain access to
any VLAN in the network.
Because the attacker is now able to access other VLANs, this is called a VLAN hopping
attack
To prevent a basic switch spoofing attack, turn off trunking on all ports, except the ones
that specifically require trunking
29
Attacks on VLANs
Double-Tagging Attack
The double-tagging attack takes advantage of the way that hardware on most switches de-
encapsulate 802.1Q tags
Most switches perform only one level of 802.1Q de-encapsulation, allowing an attacker to
embed a second, unauthorized attack header in the frame
After removing the first and legit 802.1Q header, the switch forwards the frame to the
VLAN specified in the unauthorized 802.1Q header
The best approach to mitigating double-tagging attacks is to ensure that the native VLAN
of the trunk ports is different from the VLAN of any user ports
30
Attacks on VLANs
Double-Tagging Attack
31
Design Best Practices For VLANs
VLAN Design Guideline
Move all ports from VLAN1 and assign them to a not-in-use VLAN
Make sure that only devices in the management VLAN can connect to the
switches
The switch should only accept SSH connections