You are on page 1of 37

VLAN Basic

Principle and
Configuration

www.huawei.com

Copyright © 2009 Huawei Technologies Co., Ltd. All rights reserved.


Foreword
VLAN technology provides flexible control for Ethernet, it is
applied abroad.

Copyright © 2009 Huawei Technologies Co., Ltd. All rights reserved. Page1
Objectives
Upon completion of this course, you will be able to:
Know background of generation of VLAN technology

Know generation method of VLAN tag

Master application rule of VLAN tag

Master VLAN configuration

Copyright © 2009 Huawei Technologies Co., Ltd. All rights reserved. Page2
Contents
1. VLAN Overview

2. Application Rule of VLAN Tag

3. What Is VLAN Routing

4. VLAN Routing Configuration

Copyright © 2009 Huawei Technologies Co., Ltd. All rights reserved. Page3
VLAN Generation
The Ethernet lacks of forwarding control methods .

B C
A

User :I do not want


Administrator:B can
to receive broadcast
not access A
packet from C

Copyright © 2009 Huawei Technologies Co., Ltd. All rights reserved. Page4
The Aim of VLAN

Group 2
Group 1

Copyright © 2009 Huawei Technologies Co., Ltd. All rights reserved. Page5
Implement VLAN by Tag
Management

5
Permit VLAN 1 only

A
B

Copyright © 2009 Huawei Technologies Co., Ltd. All rights reserved. Page6
VLAN Tag
6B 6B 2B 64-1500B 4B Untagged frame

DA SA TYPE DATA FCS

6B 6B 4B 2B 64-1500B 4B Tagged frame

DA SA TAG TYPE DATA FCS

2B 2B

C
0x8100 PRI F VLAN ID(
(12b)

I
TPID TCI
Copyright © 2009 Huawei Technologies Co., Ltd. All rights reserved. Page7
How to Generate VLAN Tag

Port PVID
Port 1 Port 10
Port 2 Port 7 Port1 5

Port2 10

…… ……

Port7 5
Host A Host C …… ……
Host B Host D
Port10 10

Copyright © 2009 Huawei Technologies Co., Ltd. All rights reserved. Page8
Contents
1. VLAN Overview

2. Application Rule of VLAN Tag

3. What Is VLAN Routing

4. VLAN Routing Configuration

Copyright © 2009 Huawei Technologies Co., Ltd. All rights reserved. Page9
VLAN Forwarding Procedure
Receive frame
from peer
Y
Tagged?
N
Use its own
Add PVID
vlan id

Switch has Y
created the
VLAN?
N Destination
N port allows the
VLAN to pass
Discard Y
forward/tag operation

Copyright © 2009 Huawei Technologies Co., Ltd. All rights reserved. Page10
Configure Access Port Attribute

SWA \\create VLAN


[Switch]vlan 3
Port-0/1 : VLAN-3 [Switch]vlan 5

\\configure port type


[Switch-Ethernet0/1]port link-type access
Port-0/2 : VLAN-5
[Switch-Ethernet0/2]port link-type access

\\set port PVID


[Switch-Ethernet0/1]port default vlan 3
[Switch-Ethernet0/2]port default vlan 5

Copyright © 2009 Huawei Technologies Co., Ltd. All rights reserved. Page11
VLAN Attribute on Access Port
<Quidway>display interface Ethernet 0/1
Ethernet1/0/1 current state : UP
IP Sending Frames' Format is PKTFMT_ETHNT_2
Link speed type is autonegotiation The default VLAN is
2,untagged frame will be
link duplex type is autonegotiation
forwarded after tag is added
PVID: 3
Mdi type: auto Access port,used to
connect host
Port link-type: access
Tagged VLAN ID : none VLAN that is allowed to
Untagged VLAN ID : 3 pass the port,the same
with PVID

Copyright © 2009 Huawei Technologies Co., Ltd. All rights reserved. Page12
Configure Trunk Port Attribute
SWA SWB
Port-0/3 Port-0/3

\\create VLAN
[Switch]vlan 3
[Switch]vlan 5

\\configure port type


[Switch-Ethernet0/3]port link-type trunk

\\configure Trunk-Link port PVID


[Switch-Ethernet0/3]port trunk pvid vlan 3

\\configure VLAN permitted by Trunk-Link(permitted VLAN)


[Switch-Ethernet0/3]port trunk allow-pass vlan 3 5

Copyright © 2009 Huawei Technologies Co., Ltd. All rights reserved. Page13
VLAN Attribute of Trunk port
<Quidway>display interface Ethernet 0/3
Ethernet1/0/2 current state : UP
IP Sending Frames' Format is PKTFMT_ETHNT_2
Link speed type is autonegotiation
link duplex type is autonegotiation After receive untagged frame
PVID: 3 ,add PVID 3 and forward it
Used to connect
Mdi type: auto
switch and other
Port link-type: trunk network device
VLAN passing : 1(default vlan ), 3,5
Permit multiple
VLAN permitted: 1(default vlan), 3,5 VLANs to pass

Copyright © 2009 Huawei Technologies Co., Ltd. All rights reserved. Page14
VLAN Attribute of Hybrid
Port
<Quidway>display interface Ethernet 0/1

Ethernet1/0/2 current state : UP

IP Sending Frames' Format is PKTFMT_ETHNT_2

Link speed type is autonegotiation

link duplex type is autonegotiation

PVID: 1
Forward frame
Mdi type: auto
as Trunk port
Port link-type: hybrid

Tagged VLAN ID : 3 Forward after


move the tag
Untagged VLAN ID : 1, 4

Copyright © 2009 Huawei Technologies Co., Ltd. All rights reserved. Page15
Configure Hybrid Port

[Quidway-Ethernet0/1]port link-type hybrid


[Quidway-Ethernet0/1]port hybrid pvid vlan 2
[Quidway-Ethernet0/1]port hybrid untagged vlan 2 99
Port-0/24
[Quidway-Ethernet0/3]port link-type hybrid
[Quidway-Ethernet0/3]port hybrid pvid vlan 3
[Quidway-Ethernet0/3]port hybrid untagged vlan 3 99
Port-0/1 Port-0/3
[Quidway-Ethernet0/24]port link-type hybrid
[Quidway-Ethernet0/24]port hybrid pvid vlan 99
[Quidway-Ethernet0/24]port hybrid untagged vlan 2 3 99

Copyright © 2009 Huawei Technologies Co., Ltd. All rights reserved. Page16
Dynamic Configuration for Port
VLAN Attribute
Add VLAN attribute on transition switch
Manual configuration Manual /
Automatic
Adapt to small-scale network configuration
VLAN
Automatic configuration
Trunk SWB Trunk
GVRP

VLAN-2 VLAN-2
SWA SWC

PC-1 PC-2

Copyright © 2009 Huawei Technologies Co., Ltd. All rights reserved. Page17
Configure GVRP

[Switch]gvrp
[Switch]interface Ethernet0/1
[Switch-Ethernet0/1]port link-type trunk
[Switch-Ethernet0/1]port trunk allow-pass vlan all
[Switch-Ethernet0/1]gvrp

Eth0/2

Eth0/2

Eth0/1 Eth0/1

Copyright © 2009 Huawei Technologies Co., Ltd. All rights reserved. Page18
Contents
1. VLAN Overview

2. Application Rule of VLAN Tag

3. What Is VLAN Routing

4. VLAN Routing Configuration

Copyright © 2009 Huawei Technologies Co., Ltd. All rights reserved. Page19
VLAN Disadvantage
VLAN isolates not only layer-2 broadcast but also the traffic
among different VLANs, users in different VLANs can not
communicate with each other.

Port 1 Port 2

VLAN 100 VLAN 200

Copyright © 2009 Huawei Technologies Co., Ltd. All rights reserved. Page20
Inter-VLAN Communication
Flows between different VLANs cannot directly cross
VLAN boundaries, we can use routers so that messages
can be forwarded from one VLAN to another VLAN.

VLAN 200

VLAN 100

Copyright © 2009 Huawei Technologies Co., Ltd. All rights reserved. Page21
Route Selection in inter-VLAN
Communication
A default gateway is configured at the host; for non-local communication,
the host will automatically search for the default gateway, and send the
messages to the default gateway for transferring instead of directly
sending to the destination host

Port 5 Ethernet0
192.168.200.200 VLAN200 192.168.200.1
VLAN 200
Port 2
Port 1

Port 3 Ethernet1
VLAN100 192.168.100.1

192.168.100.100
VLAN 100

Copyright © 2009 Huawei Technologies Co., Ltd. All rights reserved. Page22
One Physical Connection for
Every VLAN
VLAN is configured on layer 2 switches, and every VLAN
uses one unique physical connection to one interface of the
router.
VLAN 300

VLAN 200 Ethernet0


Ethernet1
Ethernet2

VLAN 100

Copyright © 2009 Huawei Technologies Co., Ltd. All rights reserved. Page23
Using VLAN Trunking
Configure the two ports on the link that is between switch
and router as VLAN Trunking, then multiple VLANs in the
network can share only one physical link.
VLAN 300

Ethernet0.300
Ethernet0.200
VLAN 200 Trunk Ethernet0.100

VLAN 100

Copyright © 2009 Huawei Technologies Co., Ltd. All rights reserved. Page24
Integration of Switching and
Routing
VLAN 100 VLAN 200

VLAN 300

VLAN 100 VLAN 200

L3 switch

VLAN 300
L2 switch

Functional integration of layer 2 switches and routers forms the layer


3 switch; the layer 3 switch functionally realizes VLAN classification,
VLAN internal layer 2 switching and inter-VLAN route functions.

Copyright © 2009 Huawei Technologies Co., Ltd. All rights reserved. Page25
Function Model of L3 Switch
L3 Switch
Virtual Router

Virtual Switch

VLAN100 VLAN200 VLAN300


10.110.0.254/24 10.110.1.254/24 10.110.2.254/24

10.110.0.113/24 10.110.1.69/24 10.110.1.88/24 10.110.2.200/24

GW:10.110.0.254 GW:10.110.1.254 GW:10.110.1.254 GW:10.110.2.254

Copyright © 2009 Huawei Technologies Co., Ltd. All rights reserved. Page26
Contents
1. VLAN Overview

2. Application Rule of VLAN Tag

3. What Is VLAN Routing

4. VLAN Routing Configuration

Copyright © 2009 Huawei Technologies Co., Ltd. All rights reserved. Page27
Router-on-a-stick Configuration

IP:192.168.20.30
VLAN 200 GW:192.168.20.1

SWA RTA
Port 24
Port 2 Trunk Ethernet0/1

Port 1

VLAN 100

IP:192.168.10.10
GW:192.168.10.1

Copyright © 2009 Huawei Technologies Co., Ltd. All rights reserved. Page28
Router-on-a-stick Configuration—
Switch Configuration
SWA RTA
Port 24
Trunk Ethernet0/1

[SWA]vlan batch 100 200


[SWA]interface Ethernet 0/0/1
[SWA-Ethernet0/0/1]port link-type access
[SWA-Ethernet0/0/1]port default vlan 100
[SWA]interface Ethernet 0/0/2
[SWA-Ethernet0/0/2]port link-type access
[SWA-Ethernet0/0/2]port default vlan 200
[SWA]interface Ethernet 0/0/24
[SWA-Ethernet0/0/24]port link-type trunk
[SWA-Ethernet0/0/24]port trunk allow-pass vlan all

Copyright © 2009 Huawei Technologies Co., Ltd. All rights reserved. Page29
Router-on-a-stick
Configuration—Router
Configuration
SWA RTA
Port 24
Trunk Ethernet0/1

[RTA]interface ethernet 0/1.1


[RTA-Ethernet0/1.1]dot1q termination vid 100
[RTA-Ethernet0/1.1]ip address 192.168.10.1 255.255.255.0
[RTA-Ethernet0/1.1]arp broadcast enable
[RTA]interface ethernet 0/1.2
[RTA-Ethernet0/1.2]dot1q termination vid 200
[RTA-Ethernet0/1.2]ip address 192.168.20.1 255.255.255.0
[RTA-Ethernet0/1.2]arp broadcast enable

Copyright © 2009 Huawei Technologies Co., Ltd. All rights reserved. Page30
Router-on-a-stick Configuration—
Detect Connectivity
The host 192.168.10.10 in VLAN100 ping the host
192.168.20.20 in VLAN200
C:\>ping 192.168.20.20

Pinging 192.168.20.20 with 32 bytes of data:

Reply from 192.168.20.20: bytes=32 time=2ms TTL=254


Reply from 192.168.20.20: bytes=32 time=1ms TTL=254
Reply from 192.168.20.20: bytes=32 time=1ms TTL=254
Reply from 192.168.20.20: bytes=32 time=1ms TTL=254

Ping statistics for 192.168.20.20:


Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 1ms, Maximum = 2ms, Average = 1ms

Copyright © 2009 Huawei Technologies Co., Ltd. All rights reserved. Page31
L3 Switch Configuration
IP:192.168.20.20
VLAN 200 GW:192.168.20.1

SWA
Port 2

Port 1

VLAN 100

IP:192.168.10.10
GW:192.168.10.1

Copyright © 2009 Huawei Technologies Co., Ltd. All rights reserved. Page32
L3 Switch Configuration—Switch
Configuration
SWA

Create a layer 3 logic


interface

[SWA]vlan batch 100 200


[SWA]interface vlanif 100
[SWA-Vlanif100]ip address 192.168.10.1 24
[SWA-Vlanif100]quit
[SWA]interface vlanif 200
[SWA-Vlanif200]ip address 192.168.20.1 24

Copyright © 2009 Huawei Technologies Co., Ltd. All rights reserved. Page33
L3 Switch Configuration—Detect
Connectivity
Host 192.168.10.10 in VLAN100 ping host 192.168.20.20
in VLAN200

C:\>ping 192.168.20.20

Pinging 192.168.20.20 with 32 bytes of data:

Reply from 192.168.20.20: bytes=32 time=2ms TTL=254


Reply from 192.168.20.20: bytes=32 time=1ms TTL=254
Reply from 192.168.20.20: bytes=32 time=1ms TTL=254
Reply from 192.168.20.20: bytes=32 time=1ms TTL=254

Ping statistics for 192.168.20.20:


Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 1ms, Maximum = 2ms, Average = 1ms

Copyright © 2009 Huawei Technologies Co., Ltd. All rights reserved. Page34
Summary
How many port types does switch have?

When trunk port sends out frame to peer device, must it be


tagged frame?

What is the purpose of VLAN routing?

How many methods to implement inter-VLAN


communication are there?

Copyright © 2009 Huawei Technologies Co., Ltd. All rights reserved. Page35
Thank you
www.huawei.com

You might also like