Beruflich Dokumente
Kultur Dokumente
Copyright © 2016 Huawei Technologies Co., Ltd. All rights reserved. Page 2
Objectives
Explain how VLAN routing is achieved for layer 2 & layer 3 switches.
Copyright © 2016 Huawei Technologies Co., Ltd. All rights reserved. Page 3
VLAN Disadvantages
SWA
Copyright © 2016 Huawei Technologies Co., Ltd. All rights reserved. Page 4
RTA
SWA
Host A Host B
VLAN 2 VLAN 3
VLAN frames are routed over a trunk link for port conservation.
Copyright © 2016 Huawei Technologies Co., Ltd. All rights reserved. Page 5
After VLANs are configured, the hosts in different VLANs are unable to directly
communicate with each other at Layer 2. It is therefore necessary to facilitate
the communication through the creation of routes between VLANs. There are
generally two main methods via which this is achieved, the first relies on the
implementation of a router connected to the layer 2 switch. VLAN
communication is then routed through the router before being forwarded to the
intended destination. This may be over separate physical links, which leads to
port wastage and extra link utilization, or via the same physical interface as
shown in the example.
The second method relies on the use of a layer 3 switch that is capable of
performing the operation of both the switch and the router in one single device
as a more cost effective mechanism.
VLAN Routing Features
RTA
G0/0/1.1 G0/0/1.2
192.168.2.254 192.168.3.254
VLAN Trunk
SWA
Host A Host B
GW:192.168.2.254 GW:192.168.3.254
VLAN 2 VLAN 3
Copyright © 2016 Huawei Technologies Co., Ltd. All rights reserved. Page 6
VLAN 2 G0/0/3
G0/0/1
Host B
192.168.3.1/24
[SWA]vlan batch 2 3
[SWA-GigabitEthernet0/0/1]port link-type access
[SWA-GigabitEthernet0/0/1]port default vlan 2
[SWA-GigabitEthernet0/0/2]port link-type access
[SWA-GigabitEthernet0/0/2]port default vlan 3
[SWA-GigabitEthernet0/0/3]port link-type trunk
[SWA-GigabitEthernet0/0/3]port trunk allow-pass vlan all
Copyright © 2016 Huawei Technologies Co., Ltd. All rights reserved. Page 7
The trunk link between the switch and the router must be established for
support of traffic for multiple VLANs, through the port link-type trunk or port
link-type hybrid command as well as the port trunk allow-pass vlan 2 3 or port
hybrid vlan 2 3 command respectively. Once the trunk is established, the
VLAN sub-interfaces must be implemented to allow the logical forwarding of
traffic between VLANs over the trunk link.
VLAN Routing Configuration
Host B
192.168.3.1/24
[RTA]interface GigabitEthernet0/0/1.1
[RTA-GigabitEthernet0/0/1.1]dot1q termination vid 2
[RTA-GigabitEthernet0/0/1.1]ip address 192.168.2.254 24
[RTA-GigabitEthernet0/0/1.1]arp broadcast enable
[RTA]interface GigabitEthernet0/0/1.2
[RTA-GigabitEthernet0/0/1.2]dot1q termination vid 3
[RTA-GigabitEthernet0/0/1.2]ip address 192.168.3.254 24
[RTA-GigabitEthernet0/0/1.2]arp broadcast enable
Copyright © 2016 Huawei Technologies Co., Ltd. All rights reserved. Page 8
HostA>ping 192.168.3.1
Copyright © 2016 Huawei Technologies Co., Ltd. All rights reserved. Page 9
Following the configuration of VLAN routing between VLAN 2 and VLAN 3, the
ping application can be used to verify reachability. The example demonstrates
how Host A (192.168.2.2) in VLAN 2 is capable of reaching Host B
(192.168.3.2) in VLAN 3. The TTL reflects that the packet has traversed the
router to reach the destination in VLAN 2.
L3 Switch based VLAN Routing
SWA
VLANIF 2: 192.168.2.254/24
VLANIF 3: 192.168.3.254/24
VLAN 2 VLAN 3
Copyright © 2016 Huawei Technologies Co., Ltd. All rights reserved. Page 10
VLANIF 2: 192.168.2.254/24
VLANIF 3: 192.168.3.254/24
G0/0/1 G0/0/2
VLAN 2 VLAN 3
Host A Host B
192.168.2.2/24 192.168.3.2/24
[SWA]vlan batch 2 3
[SWA]interface GigabitEthernet 0/0/1
[SWA-GigabitEthernet0/0/1]port link-type access
[SWA-GigabitEthernet0/0/1]port default vlan 2
[SWA]interface GigabitEthernet 0/0/2
[SWA-GigabitEthernet0/0/2]port link-type access
[SWA-GigabitEthernet0/0/2]port default vlan 3
Copyright © 2016 Huawei Technologies Co., Ltd. All rights reserved. Page 11
SWA
VLANIF 2: 192.168.2.254/24
VLANIF 3: 192.168.3.254/24
G0/0/1 G0/0/2
VLAN 2 VLAN 3
Host A Host B
192.168.2.2/24 192.168.3.2/24
[SWA]interface vlanif 2
[SWA-Vlanif2]ip address 192.168.2.254 24
[SWA-Vlanif2]quit
[SWA]interface vlanif 3
[SWA-Vlanif3]ip address 192.168.3.254 24
[SWA-Vlanif3]quit
Copyright © 2016 Huawei Technologies Co., Ltd. All rights reserved. Page 12
Copyright © 2016 Huawei Technologies Co., Ltd. All rights reserved. Page 13