08+VLAN+Principles+and+Configuration
08+VLAN+Principles+and+Configuration
Page 1 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Foreword
⚫ Ethernet technology implements data communication over shared media based on
carrier sense multiple access with collision detection (CSMA/CD). If there are a large
number of PCs on the Ethernet, security risks and broadcast storms may occur,
deteriorating network performance and even causing network breakdowns.
⚫ The virtual local area network (VLAN) technology is therefore introduced to solve
the preceding problem.
⚫ This course describes basic VLAN principles, working principles of different Layer 2
interfaces, VLAN applications, data forwarding principles, and basic VLAN
configuration methods.
Page 2 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Objectives
⚫ On completion of this course, you will be able to:
▫ Understand the background of the VLAN technology.
Page 3 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Contents
1. What Is VLAN
2. VLAN Principles
3. VLAN Applications
Page 4 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Issues Facing a Traditional Ethernet
⚫ On a typical switching
Layer 2 broadcast domain
network,broadcast frames
or unknown unicast frames
SW4 SW5
sent by a PC are flooded in
the entire broadcast
Unicast
frame PC2 domain.
⚫ The larger the broadcast
PC1 SW1 SW2 SW3
domain is, the more serious
network security and junk
SW6 SW7
traffic problems are.
Valid traffic
Junk traffic
(Note: This example assumes that the MAC address entry of PC2 exists in
the MAC address tables of SW1, SW3, and SW7 rather than SW2 and SW5.)
Page 5 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
VLAN
VLAN
(multiple broadcast domains) • The VLAN technology
isolates broadcast
SW4 SW5
domains.
Broadcast
frame PC2 • Characteristics:
▫ Geographically
PC1 SW1 SW2 SW3
independent.
Page 6 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Contents
1. What Is VLAN
2. VLAN Principles
3. VLAN Applications
Page 7 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
VLAN VLAN VLAN Frame
Identification Assignment Processing
VLAN Implementation
Switch1 Frame Switch2
1 2 3 4 5 5 4 3 2 1
Frame
⚫ Switch1 and Switch2 belong to the network of the same enterprise. VLANs are planned for the network, with VLAN 10 for
department A and VLAN 20 for department B. Employees in departments A and B are connected to both Switch1 and Switch2.
⚫ Assume that a frame sent from PC1 reaches Switch2 through the link between Switch1 and Switch2. If no processing is implemented,
Switch2 can neither identify the VLAN to which the frame belongs nor determine the local VLAN to which the frame should be sent.
Page 8 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
VLAN VLAN VLAN Frame
Identification Assignment Processing
VLAN Tag
⚫ How does a switch identify the VLAN to which a received frame belongs?
Which VLAN does
the received frame
belong to? VLAN Tag
20
IEEE 802.1Q defines a 4-byte
VLAN tag for Ethernet frames,
enabling switches to identify
the VLANs to which received
frames belong.
VLAN 20 VLAN 10
Page 9 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
VLAN VLAN VLAN Frame
Identification Assignment Processing
VLAN Frame
Original Ethernet frame Destination MAC Source MAC Length/
Data FCS
(untagged frame) address address Type
Page 10 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
VLAN VLAN VLAN Frame
Identification Assignment Processing
VLAN Implementation
Tagged frame
Switch1 Switch2
Tagged frame
1 2 3 4 5 5 4 3 2 1
⚫ The link between Switch1 and Switch2 carries data of multiple VLANs. In this situation, a VLAN-based
data tagging method is required to distinguish the frames of different VLANs.
⚫ IEEE 802.1Q, often referred to as Dot1q, defines a system of VLAN tagging for Ethernet frames by
inserting an 802.1Q tag into the frame header to carry VLAN information.
Page 12 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
VLAN VLAN VLAN Frame
Identification Assignment Processing
Page 13 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
VLAN VLAN VLAN Frame
Identification Assignment Processing
Page 15 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
VLAN VLAN VLAN Frame
Identification Assignment Processing
Page 16 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
VLAN VLAN VLAN Frame
Identification Assignment Processing
• Trunk interface
A trunk interface allows frames that belong to multiple VLANs to
pass through and differentiates the frames using the 802.1Q tag.
This type of interface is used to connect a switch to another
switch or a sub-interface on a device, such as a router or firewall.
• Hybrid interface
VLAN10 VLAN20 VLAN10 VLAN20 Similar to a trunk interface, a hybrid interface also allows frames
that belong to multiple VLANs to pass through and differentiates
the frames using the 802.1Q tag. You can determine whether to
Access interface Trunk interface allow a hybrid interface to carry VLAN tags when sending the
frames of one or more VLANs.
Page 17 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
VLAN VLAN VLAN Frame
Identification Assignment Processing
Access Interface
Frame receiving Frame sending
10 10 10 20
After receiving an After receiving a tagged frame: If the VLAN ID of the frame is If the VLAN ID of the frame is
untagged frame: If the VLAN ID of the frame is the the same as the PVID of the different from the PVID of the
interface: interface:
The interface permits the same as the PVID of the interface,
frame and adds a VLAN tag the interface permits the frame. The interface removes the VLAN The interface discards the frame.
carrying the PVID of the tag from the frame and then
If the VLAN ID of the frame is
interface. sends the frame.
different from the PVID of the Untagged Tagged
interface, the interface discards 10
frame frame
the frame.
Page 18 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
VLAN VLAN VLAN Frame
Identification Assignment Processing
Trunk interface
Frame receiving Frame sending
10 10 10 20
After receiving an untagged After receiving a tagged frame: If the VLAN ID of the frame is If the VLAN ID of the frame is
frame: the same as the PVID of the different from the PVID of the
If the VLAN ID of the frame is in
interface: interface:
The interface adds a VLAN tag the list of VLAN IDs permitted by
with the VID being the PVID of the interface, the interface If the VLAN ID of the frame is in If the VLAN ID of the frame is in
the interface to the frame and permits the frame. Otherwise, the the list of VLAN IDs permitted by the list of VLAN IDs permitted by
permits the frame only when the interface discards the frame. the interface, the interface the interface, the interface sends
VID is in the list of VLAN IDs removes the tag from the frame the frame out without removing
permitted by the interface. If the Untagged Tagged and sends the frame out. the tag of the frame. Otherwise,
VID is not in the list, the interface 10 Otherwise, the interface discards the interface discards the frame.
frame frame
discards the frame. the frame.
Page 19 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
VLAN VLAN VLAN Frame
Identification Assignment Processing
Page 21 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
VLAN VLAN VLAN Frame
Identification Assignment Processing
Hybrid Interface
Frame receiving Frame sending
10 10 10 20
After receiving an untagged After receiving a tagged frame: If the VLAN ID of the frame is If the VLAN ID of the frame is
frame: in the list of VLAN IDs in the list of VLAN IDs
If the VLAN ID of the frame is in
permitted by the interface: permitted by the interface:
The interface adds a VLAN tag the list of VLAN IDs permitted by
with the VID being the PVID of the interface, the interface If the interface has been If the interface has been
the interface to the frame and permits the frame. Otherwise, the configured not to carry VLAN tags configured to carry VLAN tags
permits the frame only when the interface discards the frame. when sending frames, it removes when sending frames, it sends the
VID is in the list of VLAN IDs the tag from the frame and then frame out without removing the
permitted by the interface. If the Untagged Tagged sends the frame out. tag of the frame.
VID is not in the list, the interface 10
frame frame
discards the frame.
Page 22 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
VLAN VLAN VLAN Frame
Identification Assignment Processing
Interface 1 Interface 2 1 1 10
PVID 10 PVID 20 Interface 1 VLAN VLAN VLAN
PVID 100 10 20 20
ID ID ID
100 100 100
Page 24 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
VLAN VLAN VLAN Frame
Identification Assignment Processing
Summary
Access Interface Trunk Interface Hybrid Interface
Frame receiving Frame receiving Frame receiving
▫ Untagged frame: adds a tag with the VID ▫ Untagged frame: adds a tag with the VID ▫ Untagged frame: adds a tag with the VID
being the PVID of the interface and permits being the PVID of the interface and checks being the PVID of the interface and checks
the frame. whether the VID is in the list of permitted whether the VID is in the list of permitted
▫ Tagged frame: checks whether the VID in the VLAN IDs. If yes, permits the frame. If not, VLAN IDs. If yes, permits the frame. If not,
discards it. discards it.
tag of the frame is the same as the PVID of
the interface. If they are the same, permits ▫ Tagged frame: checks whether the VID is in ▫ Tagged frame: checks whether the VID is in
the frame; otherwise, discards the frame. the list of permitted VLAN IDs. If yes, permits the list of permitted VLAN IDs. If yes, permits
the frame. If not, discards it. the frame. If not, discards it.
Page 25 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Contents
1. What Is VLAN
2. VLAN Principles
3. VLAN Applications
Page 26 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
VLAN Planning
• VLAN assignment rules • Tips for VLAN assignment
▫ By service: voice, video, and data VLANs VLAN IDs can be randomly assigned within the
supported range. To improve VLAN ID continuity, you
▫ By department: e.g. VLANs for engineering, marketing, and can associate VLAN IDs with subnets during VLAN
assignment.
financing departments
Page 27 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Interface-based VLAN Assignment
⚫ Applicable scenario:
Internet
▫ There are multiple enterprises in a building. These
enterprises share network resources to reduce costs.
Networks of the enterprises connect to different interfaces
of the same Layer 2 switch and access the Internet
L3 switch
through the same egress device.
⚫ VLAN assignment:
L2 switch
▫ To isolate the services of different enterprises and ensure
service security, assign interfaces connected to the
enterprises' networks to different VLANs. In this way, each
enterprise has an independent network, and each VLAN
Enterprise 1 Enterprise 2 Enterprise 3
works as a virtual work group.
VLAN 2 VLAN 3 VLAN 4
Page 28 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
MAC Address-based VLAN Assignment
⚫ Applicable scenario:
Enterprise
▫ The network administrator of an enterprise assigns network
PCs in the same department to the same VLAN. To
GE 0/0/1
improve information security, the enterprise SW1
requires that only employees in the specified
GE 0/0/3
department be allowed to access specific network
resources.
⚫ VLAN assignment:
▫ To meet the preceding requirement, configure MAC
PC1 PC2 PC3 PC4
address-based VLAN assignment on SW1, 001e-10dd-dd01 001e-10dd-dd02 001e-10dd-dd03 001e-10dd-dd04
Page 29 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Contents
1. What Is VLAN
2. VLAN Principles
3. VLAN Applications
Page 30 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Interface-based VLAN MAC Address-based VLAN
Assignment Assignment
This command creates a VLAN and displays the VLAN view. If the VLAN to be created already exists, this
command directly displays the VLAN view.
• The value of vlan-id is an integer ranging from 1 to 4094.
Page 31 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Interface-based VLAN MAC Address-based VLAN
Assignment Assignment
In the interface view, set the link type of the interface to access.
In the interface view, configure a default VLAN for the interface and add the interface to the VLAN.
• vlan-id: specifies an ID for the default VLAN. The value is an integer ranging from 1 to 4094.
Page 32 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Interface-based VLAN MAC Address-based VLAN
Assignment Assignment
In the interface view, set the link type of the interface to trunk.
In the interface view, configure a default VLAN for the trunk interface.
Page 33 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Interface-based VLAN MAC Address-based VLAN
Assignment Assignment
In the interface view, set the link type of the interface to hybrid.
In the interface view, add the hybrid interface to specified VLANs in untagged mode.
In the interface view, add the hybrid interface to specified VLANs in tagged mode.
In the interface view, configure a default VLAN for the hybrid interface.
Page 34 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Interface-based VLAN MAC Address-based VLAN
Assignment Assignment
Trunk interface
Page 35 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Interface-based VLAN MAC Address-based VLAN
Assignment Assignment
Creating VLANs
SW1 SW2
GE 0/0/3 GE 0/0/3
PVID 1 PVID 1 Create VLANs.
Page 36 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Interface-based VLAN MAC Address-based VLAN
Assignment Assignment
Page 37 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Interface-based VLAN MAC Address-based VLAN
Assignment Assignment
[SW1]display vlan
SW1 SW2 The total number of vlans is : 3
GE 0/0/3 GE 0/0/3 -------------------------------------------------------------------------------
PVID 1 PVID 1 U: Up; D: Down; TG: Tagged; UT: Untagged;
MP: Vlan-mapping; ST: Vlan-stacking;
GE 0/0/1 GE 0/0/2 GE 0/0/1 GE 0/0/2 #: ProtocolTransparent-vlan; *: Management-vlan;
PVID 10 PVID 20 PVID 10 PVID 20
-------------------------------------------------------------------------------
VID Type Ports
-------------------------------------------------------------------------------
1 common UT:GE0/0/3(U) ……
10 common UT:GE0/0/1(U)
TG:GE0/0/3(U)
PC1 PC2 PC3 PC4 20 common UT:GE0/0/2(U)
TG:GE0/0/3(U)
VLAN 10 VLAN 20 VLAN 10 VLAN 20
……
Page 38 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Interface-based VLAN MAC Address-based VLAN
Assignment Assignment
Page 39 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Interface-based VLAN MAC Address-based VLAN
Assignment Assignment
SW1 configuration:
SW1 SW2
GE 0/0/3 GE 0/0/3
PVID 1 PVID 1 [SW1] vlan batch 10 20 100
[SW1] interface GigabitEthernet 0/0/1
GE 0/0/1 GE 0/0/2
PVID 10 PVID 20 GE 0/0/1 [SW1-GigabitEthernet0/0/1] port link-type hybrid
PVID 100
[SW1-GigabitEthernet0/0/1] port hybrid pvid vlan 10
[SW1-GigabitEthernet0/0/1] port hybrid untagged vlan 10 100
[SW1-GigabitEthernet0/0/1] interface GigabitEthernet 0/0/2
[SW1-GigabitEthernet0/0/2] port link-type hybrid
[SW1-GigabitEthernet0/0/2] port hybrid pvid vlan 20
PC1 PC2 Server
[SW1-GigabitEthernet0/0/2] port hybrid untagged vlan 20 100
VLAN 10 VLAN 20 VLAN 100 [SW1-GigabitEthernet0/0/2] interface GigabitEthernet 0/0/3
[SW1-GigabitEthernet0/0/3] port link-type hybrid
[SW1-GigabitEthernet0/0/3] port hybrid tagged vlan 10 20 100
Page 40 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Interface-based VLAN MAC Address-based VLAN
Assignment Assignment
SW2 configuration:
SW1 SW2
GE 0/0/3 GE 0/0/3
PVID 1 PVID 1 [SW2] vlan batch 10 20 100
[SW2] interface GigabitEthernet 0/0/1
GE 0/0/1 GE 0/0/2
PVID 10 PVID 20 GE 0/0/1 [SW2-GigabitEthernet0/0/1] port link-type hybrid
PVID 100
[SW2-GigabitEthernet0/0/1] port hybrid pvid vlan 100
[SW2-GigabitEthernet0/0/1] port hybrid untagged vlan 10 20 100
[SW2-GigabitEthernet0/0/1] interface GigabitEthernet 0/0/3
[SW2-GigabitEthernet0/0/3] port link-type hybrid
[SW2-GigabitEthernet0/0/3] port hybrid tagged vlan 10 20 100
PC1 PC2 Server
VLAN 10 VLAN 20 VLAN 100
Page 41 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Interface-based VLAN MAC Address-based VLAN
Assignment Assignment
[SW1]display vlan
The total number of vlans is : 4
SW1 SW2 -----------------------------------------------------------------------------------------
GE 0/0/3 GE 0/0/3
PVID 1 PVID 1 U: Up; D: Down; TG: Tagged; UT: Untagged;
MP: Vlan-mapping; ST: Vlan-stacking;
GE 0/0/1 GE 0/0/2
PVID 10 PVID 20 GE 0/0/1 #: ProtocolTransparent-vlan; *: Management-vlan;
PVID 100 -----------------------------------------------------------------------------------------
VID Type Ports
-----------------------------------------------------------------------------------------
1 common UT:GE0/0/1(U) GE0/0/2(U) GE0/0/3(U) ……
10 common UT:GE0/0/1(U)
TG:GE0/0/3(U)
20 common UT:GE0/0/2(U)
PC1 PC2 Server
TG:GE0/0/3(U)
VLAN 10 VLAN 20 VLAN 100
100 common UT:GE0/0/1(U) GE0/0/2(U)
TG:GE0/0/3(U)
……
Page 42 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Interface-based VLAN MAC Address-based VLAN
Assignment Assignment
Page 44 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Interface-based VLAN MAC Address-based VLAN
Assignment Assignment
[SW1] vlan 10
[SW1-vlan10] mac-vlan mac-address 001e-10dd-dd01
[SW1-vlan10] mac-vlan mac-address 001e-10dd-dd02
[SW1-vlan10] mac-vlan mac-address 001e-10dd-dd03
PC1 PC2 PC3
001e-10dd-dd01 001e-10dd-dd02 001e-10dd-dd03
[SW1-vlan10] quit
VLAN 10
Page 45 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Interface-based VLAN MAC Address-based VLAN
Assignment Assignment
Page 46 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Interface-based VLAN MAC Address-based VLAN
Assignment Assignment
Page 47 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Quiz
1. (Multiple) Which of the following statements about the VLAN technology are incorrect?
( )
A. The VLAN technology can isolate a large collision domain into several small collision domains.
B. The VLAN technology can isolate a large Layer 2 broadcast domain into several small Layer 2
broadcast domains.
2. If the PVID of a trunk interface is 5 and the port trunk allow-pass vlan 2 3 command is run
on the interface, which VLANs' frames can be transmitted through the trunk interface?
Page 48 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Summary
⚫ This course describes the VLAN technology, including the functions, identification,
assignment, data exchange, planning, application, and basic configuration of VLANs.
⚫ The VLAN technology can divide a physical LAN into multiple broadcast domains so
that network devices in the same VLAN can directly communicate at Layer 2, while
devices in different VLANs cannot.
Page 49 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Thank You
www.huawei.com
Page 50 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.