10 - Inter-VLAN Communication
10 - Inter-VLAN Communication
Page
Course Code Product Product Version Course Version
V5R2 V1R1
age 1 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Inter-VLAN Communication
age 2 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Forewor
d
By default, a Layer 2 switching network is a broadcast domain, which brings
many problems. Virtual local area network (VLAN) technology isolates such
broadcast domains, preventing users in different VLANs from communicating
with each other. However, such users sometimes need to communicate.
This course describes how to implement inter-VLAN communication.
age 3 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Objective
s
On completion of this course, you will be able to understand:
Methods of implementing inter-VLAN communication.
How to use routers (physical interfaces or sub-interfaces) to implement inter-
VLAN communication.
How to use Layer 3 switches to implement inter-VLAN communication.
How Layer 3 packets are forwarded.
age 4 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Content
s
1. Background
2. Using Routers' Physical Interfaces or Sub-interfaces to Implement Inter-
VLAN Communication
3. Using VLANIF Interfaces to Implement Inter-VLAN Communication
4. Layer 3 Communication Process
age 5 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Inter-VLAN Communication (1)
In real-world network deployments, different IP address segments are assigned to different VLANs.
PCs on the same network segment in the same VLAN can directly communicate with each other without
the need for Layer 3 forwarding devices. This communication mode is called Layer 2 communication.
Inter-VLAN communication belongs to Layer 3 communication, which requires Layer 3 devices.
Layer 2 switch
Layer 2 Layer 2
communicatio communication
n
VLAN VLAN
10
192.168.10.0/2 20
192.168.20.0/2
4 4
Layer 3 communication
age 6 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Inter-VLAN Communication (2)
Common Layer 3 devices: routers, Layer 3 switches, firewalls, etc.
Inter-VLAN communication is implemented by connecting a Layer 2 switch to a
Layer 3 interface of a Layer 3 device. The communication packets are routed by the
Layer 3 device. 3
3
2 Layer 2
interface Rout 2
3 Layer 3 2
er Layer 2 switch
interface 2
2
2 2
VLAN VLAN
10
192.168.10.0/2 20
192.168.20.0/2
4 4
age 7 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Content
s
1. Background
2. Using Routers' Physical Interfaces or Sub-interfaces to Implement
Inter-VLAN Communication
3. Using VLANIF Interfaces to Implement Inter-VLAN Communication
4. Layer 3 Communication Process
age 8 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Using Physical Using Sub-
Interfaces interfaces
G 0/0/24
Different from a physical interface, a sub-
Trunk VLANs 10
interface can terminate data frames with VLAN
20
GE 0/0/1 GE 0/0/2 tags.
Access (VLAN 10) SW Access (VLAN 20)
1
You can create multiple sub-interfaces on one
physical interface. After connecting the physical
VLAN VLAN
10 20 interface to the trunk interface of the switch,
PC1 PC2
192.168.10.2/24 192.168.20.2/24
the physical interface can provide Layer 3
Default gateway: Default gateway:
forwarding services for multiple VLANs.
192.168.10.254 192.168.20.254
age 10 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Using Physical Using Sub-
Interfaces interfaces
Sub-Interface Processing
The interface connecting the switch to the router is set to a trunk interface. The router
forwards the received packets to the corresponding sub-interfaces according to the VLAN tags
in the packets. Packets carrying VLAN
GE GE
0/0/1.10 0/0/1.20 10
Packets carrying VLAN 20
GE 0/0/1 R1 GE
R1 GE 0/0/1.10
GE
0/0/1
0/0/1.20
age 11 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Using Physical Using Sub-
Interfaces interfaces
age 13 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Layer 3 Switch and VLANIF Interfaces
VLAN VLAN
Switching switching module for re-encapsulation.
module
10 20
5. The switching module searches its MAC
5 address table to determine the outbound
Access interface interface of the frame and whether the frame
needs to carry a VLAN tag. Data frame sent by
PC1 PC2
IP: 192.168.10.2/24 IP: 192.168.20.2/24
the switching module: source MAC = MAC2,
Default gateway: Default gateway: destination MAC = MAC3, VLAN tag = None
192.168.10.254 192.168.20.254
MAC: MAC1 MAC: MAC3
age 18 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Content
s
1. Background
2. Using Routers' Physical Interfaces or Sub-interfaces to Implement Inter-
VLAN Communication
3. Using VLANIF Interfaces to Implement Inter-VLAN Communication
4. Layer 3 Communication Process
age 19 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Network Logical Communicatio
Topology Connection n Process
Network Topology
VLAN
10
PC1
IP: 192.168.10.2/24 R1
Default gateway:
SW SW NAT
192.168.10.254
1 GE 0/0/1 2
IS
GE GE 0/0/2 GE 0/0/0 1.2.3.4
P
0/0/24 Serve
r
VLAN
• VLANIF 10: 192.168.10.254 2.3.4.
20 24 5
PC2
IP: 192.168.20.2/24 • VLANIF 20: 192.168.20.254
Default gateway:
192.168.20.254
24
• VLANIF 30: 192.168.30.1 24
age 20 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Network Logical Communicatio
Topology Connection n Process
Logical Connection
Logical Connection
• Configure a default route
VLANIF VLANIF VLANIF Routing on SW2 to allow intranet
10 20 30 module users to access the
Internet.
SW2 Switchin R1
g NAT
VLAN module
30 Interne
t
Access interface
Trunk interface
SW1 • On R1, configure static routes
VLAN VLAN
10 20
to the user network segments
of VLAN 10 and VLAN 20.
Trunk
• To enable intranet PCs using
GE 0/0/1 GE GE 0/0/2
0/0/24 private IP addresses to access
the Internet, configure Network
Address and Port Translation
(NAPT) on R1.
age 21 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Network Logical Communicatio
Topology Connection n Process
VLANIF 30
IP: 192.168.30.1/24
IP: 192.168.10.2/24 MAC: MAC2
Default gateway:
192.168.10.254 R1
MAC: MAC1 SW SW NA
GE 1 GE 0/0/1 2 T
0/0/1 IS
GE GE 0/0/2 GE 0/0/0 1.2.3.4
VLAN P
0/0/24 192.168.30 Serve
10
.2 r
Source MAC: MAC1 MAC: MAC3 2.3.4.
PC Processing Destination MAC: MAC2 5
Before sending a packet to VLAN tag: None
2.3.4.5, the PC sends the
packet to its gateway after Source IP: 192.168.10.2
determining that the Destination IP: 2.3.4.5
destination IP address is
not on its network segment.
age 22 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Network Logical Communicatio
Topology Connection n Process
VLANIF 30
IP: 192.168.30.1/24
IP: 192.168.10.2/24 MAC: MAC2
Default gateway:
192.168.10.254 R1
MAC: MAC1 SW SW NA
GE 1 GE 0/0/1 2 T
0/0/1 IS
GE GE 0/0/2 GE 0/0/0 1.2.3.4
VLAN P
0/0/24 192.168.30 Serve
10
.2 r
MAC VLAN Interface MAC: MAC3 2.3.4.
Address 5
MAC1 10 GE 0/0/1 Source MAC: MAC1
MAC2 10 GE 0/0/24 Destination MAC: MAC2
SW1 Processing VLAN tag: 10
age 23 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Network Logical Communicatio
Topology Connection n Process
VLANIF 30
IP: 192.168.30.1/24
IP: 192.168.10.2/24 MAC: MAC2
Default gateway:
192.168.10.254 R1
MAC: MAC1 SW SW NA
GE 1 GE 0/0/1 2 T
0/0/1 IS
GE GE 0/0/2 GE 0/0/0 1.2.3.4
VLAN P
0/0/24 192.168.30 Serve
10
Operational data of Destination Outbound .2 r
Next Hop
a routing table. Network Interface MAC: MAC3 2.3.4.
192.168.30 5
0.0.0.0/0 VLANIF30
.2
SW2 Processing
After SW2 receives the frame, it finds that the destination MAC address is the
MAC address of its VLANIF 10 and sends the frame to the routing module,
which then searches the routing table for a route matching the destination IP
address 2.3.4.5.
After finding that the matching route is a default route, the outbound interface
is VLANIF 30, and the next hop is 192.168.30.2, SW2 searches its ARP table to
obtain the MAC address corresponding to 192.168.30.2.
age 24 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Network Logical Communicatio
Topology Connection n Process
VLANIF 30
IP: 192.168.30.1/24
IP: 192.168.10.2/24 MAC: MAC2
Default gateway:
192.168.10.254 R1
MAC: MAC1 SW SW NA
GE 1 GE 0/0/1 2 T
0/0/1 IS
GE GE 0/0/2 GE 0/0/0 1.2.3.4
VLAN P
0/0/24 192.168.30 Serve
10
.2 r
Outbound MAC: MAC3 2.3.4.
ARP Destination Network MAC
Interface
entry Source MAC: MAC2 5
192.168.30.2 MAC3 GE 0/0/2
Destination MAC: MAC3
SW2 Processing
Source IP: 192.168.10.2
After finding the MAC address corresponding to
192.168.30.2, SW2 replaces the source MAC address of Destination IP: 2.3.4.5
the packet with the MAC address of VLANIF 30, and
forwards the packet to the switching module. The
switching module searches the MAC address table for the
outbound interface and determines whether the packet
carries a VLAN tag.
age 25 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Network Logical Communicatio
Topology Connection n Process
VLANIF 30
IP: 192.168.30.1/24
IP: 192.168.10.2/24 MAC: MAC2
Default gateway:
192.168.10.254 R1
MAC: MAC1 SW SW NA
GE 1 GE 0/0/1 2 T
0/0/1 IS
GE GE 0/0/2 GE 0/0/0 1.2.3.4
VLAN P
0/0/24 192.168.30 Serve
10
.2 r
MAC: MAC3 2.3.4.
Source IP: 1.2.3.4 5
R1 Processing
Destination IP: 2.3.4.5
Checks the destination MAC address of the data
packet and finds that the MAC address belongs to
its interface. Checks the destination IP address and
finds that it is not a local IP address. Searches the
routing table, finds a default matching route, and
forwards the packet to a carrier device while
performing NAT to translate the source IP address
and port number of the packet.
age 26 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Quiz
1. When a sub-interface is used to implement inter-VLAN communication, how does
the switch interface connected to the router need to be configured?
2. How are packets changed when being forwarded at Layer 3?
age 27 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Summar
y
This course describes three methods of implementing inter-VLAN
communication: through physical interfaces, sub-interfaces, and VLANIF
interfaces.
It also elaborates the Layer 3 communication process, and device processing
mechanism and packet header changes during the communication.
age 28 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
More Information
Comparison between Layer 2 and Layer 3 interfaces
Layer 2 interfaces do not isolate broadcast domains. They Layer 3 interfaces isolate broadcast domains. They directly terminate
flood received broadcast frames. received broadcast frames instead of flooding them.
age 29 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Thank You
www.huawei.com
age 30 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.