0% found this document useful (0 votes)
99 views9 pages

3-Options For Inter-VLAN Routing - Implementing and Administering Cisco Solutions

Inter-VLAN routing allows network traffic to be forwarded between VLANs using a Layer 3 device. There are three main options for inter-VLAN routing: 1) Using a router with separate interfaces in each VLAN, 2) Using a router connected to a trunk port on a switch in a "router on a stick" configuration with subinterfaces to route between VLANs, 3) Using a Layer 3 switch capable of inter-VLAN routing to replace dedicated routers for basic routing functions.

Uploaded by

Daniel Cafu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
99 views9 pages

3-Options For Inter-VLAN Routing - Implementing and Administering Cisco Solutions

Inter-VLAN routing allows network traffic to be forwarded between VLANs using a Layer 3 device. There are three main options for inter-VLAN routing: 1) Using a router with separate interfaces in each VLAN, 2) Using a router connected to a trunk port on a switch in a "router on a stick" configuration with subinterfaces to route between VLANs, 3) Using a Layer 3 switch capable of inter-VLAN routing to replace dedicated routers for basic routing functions.

Uploaded by

Daniel Cafu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

3/26/2020 Options for Inter-VLAN Routing | Implementing and Administering Cisco Solutions

Implementing and Administering Cisco Solutions


ondemandelearning.cisco.com/cisco-cte/ccna10/sections/16/pages/3

Open Transcript
Open Transcript
Inter-VLAN routing is a process of forwarding network traffic from one VLAN to another VLAN
using a Layer 3 device.

Option 1: Router with a Separate Interface in Each VLAN

Traditional inter-VLAN routing requires multiple physical interfaces on both the router and the
switch. VLANs are associated with unique IP subnets on the network. This subnet configuration
facilitates the routing process in a multi-VLAN environment. When you use a router to facilitate
inter-VLAN routing, the router interfaces are connected to switch interfaces that are in separate

https://ondemandelearning.cisco.com/cisco-cte/ccna10/sections/16/pages/3 1/9
3/26/2020 Options for Inter-VLAN Routing | Implementing and Administering Cisco Solutions

VLANs. Devices on these VLANs send traffic through the router to reach other VLANs. However,
when you use a separate interface for each VLAN on a router, you can quickly run out of
interfaces. This solution is not very scalable.

Option 2: Router on a Stick


Not all inter-VLAN routing configurations require multiple physical interfaces. Some router
software permits configuring router interfaces as trunk links. Trunk links open up new possibilities
for inter-VLAN routing. A router on a stick is a type of router configuration in which a single
physical interface routes traffic among multiple VLANs on a network.

The figure shows a router that is attached to a switch. The router interface is configured to
operate as a trunk link and is connected to a switch port that is configured as a trunk. The router
performs inter-VLAN routing by accepting VLAN-tagged traffic on the trunk interface coming from
the adjacent switch and internally routing between the VLANs using subinterfaces. Subinterfaces
are multiple virtual interfaces that are associated with one physical interface. To perform inter-
VLAN routing functions, the router must know how to reach all VLANs that are being
interconnected; there must be a separate logical connection on the router for each VLAN. VLAN
trunking (such as Institute of Electrical and Electronics Engineers [IEEE] 802.1Q) must be
enabled on these connections.

https://ondemandelearning.cisco.com/cisco-cte/ccna10/sections/16/pages/3 2/9
3/26/2020 Options for Inter-VLAN Routing | Implementing and Administering Cisco Solutions

These subinterfaces are configured in software. Each is independently configured with its own IP
addresses and VLAN assignment. The router routes packets incoming from one subinterface and
then sends the data on another subinterface by putting it in a VLAN-tagged frame and sending it
back out the same physical interface. Devices on the VLANs have their default gateway set to the
appropriate router IP address; in this figure, the devices in VLAN 10 will have default gateway set
to 10.1.10.1, and the devices in VLAN 20 will have default gateway set to 10.1.20.1.

Router Trunk Link Configuration Example


The following example shows how you can configure a router on a stick, by cconfiguring
subinterfaces and trunking on the router:

Learning Activity

The commands used on the router are as follows:

Command and Variable Description

interface interface | Enters interface or subinterface configuration mode


subinterface

encapsulation dot1q Defines the encapsulation format as IEEE 802.1Q and


vlan_number specifies the VLAN identifier

https://ondemandelearning.cisco.com/cisco-cte/ccna10/sections/16/pages/3 3/9
3/26/2020 Options for Inter-VLAN Routing | Implementing and Administering Cisco Solutions

Command and Variable Description

ip address ip_address Assigns an IPv4 address and network mask to an


network_mask interface

In the figure, the GigabitEthernet0/0 interface is divided into two subinterfaces—


GigabitEthernet0/0.10 and GigabitEthernet0/0.20. Each subinterface represents the router in
each of the VLANs for which it routes.

In the example, the encapsulation dot1q 20 command enables 802.1Q encapsulation trunking
on the GigabitEthernet0/0.20 subinterface. The value 20 represents the VLAN number (or VLAN
identifier), therefore associating 802.1Q-tagged traffic from this VLAN with the subinterface.

Each 802.1Q-tagged VLAN on the trunk link requires a subinterface with 802.1Q encapsulation
trunking that is enabled in this manner. The subinterface number does not have to be the same
as the dot1q VLAN number. However, management and troubleshooting are easier when the two
numbers are the same.

In this example, devices in different VLANs use the subinterfaces of the router as default
gateways to access the devices that are connected to the other VLANs.

On the switch, assign ports to specific VLANs and configure the port toward the router as a trunk.
The trunk link will carry traffic from different VLANs, and the router will route between these
VLANs.

Learning Activity

https://ondemandelearning.cisco.com/cisco-cte/ccna10/sections/16/pages/3 4/9
3/26/2020 Options for Inter-VLAN Routing | Implementing and Administering Cisco Solutions

The commands used on the switch are as follows:

Command and Description


Variable

interface Enters interface configuration mode.


interface

switchport Sets the interface to trunk mode.


mode trunk

switchport Sets the interface to access mode.


mode access

switchport Sets the access VLAN when the interface is in the access mode. To
access reset the access-mode VLAN to the appropriate default VLAN for the
vlan_number switch, use the no form of this command.

Verify VLAN Subinterfaces


To verify the router configuration, use the show commands to display the VLANs and IP routing
information for each VLAN to verify that the routing table includes the subnets of all VLANs.

Verify the VLAN subinterfaces, using the show vlans command.

https://ondemandelearning.cisco.com/cisco-cte/ccna10/sections/16/pages/3 5/9
3/26/2020 Options for Inter-VLAN Routing | Implementing and Administering Cisco Solutions

Router# show vlans


<... output omitted ....>
Virtual LAN ID: 10 (IEEE 802.1Q Encapsulation)

vLAN Trunk Interface: GigabitEthernet0/0.10

Protocols Configured: Address: Received: Transmitted:


IP 10.1.10.1 11 18
<... output omitted ...>
Virtual LAN ID: 20 (IEEE 802.1Q Encapsulation)

vLAN Trunk Interface: GigabitEthernet0/0.20


Protocols Configured: Address: Received: Transmitted:
IP 10.1.20.1 11 8
<... output omitted ...>

The sample output shows two VLAN subinterfaces—GigabitEthernet0/0.10 and


GigabitEthernet0/0.20.

Verify the IPv4 routing table for the VLAN subinterfaces, using the show ip route command.

Router# show ip route


<--- output omitted --->

Gateway of last resort is not set 10.0.0.0/8 is variably subnetted, 8 subnets, 2 masks
C 10.1.1.0/24 is directly connected, Ethernet0/0
L 10.1.10.1/32 is directly connected, GigabitEthernet0/0.10
C 10.1.10.0/24 is directly connected, GigabitEthernet0/0.10
L 10.1.20.1/32 is directly connected, GigabitEthernet0/0.20
C 10.1.20.0/24 is directly connected, GigabitEthernet0/0.20

The show ip route command displays the state of the routing table. The sample output shows
two subinterfaces. The GigabitEthernet0/0.10 and GigabitEthernet0/0.20 VLAN subinterfaces are
directly connected to the router.

Option 3: Layer 3 Switch

https://ondemandelearning.cisco.com/cisco-cte/ccna10/sections/16/pages/3 6/9
3/26/2020 Options for Inter-VLAN Routing | Implementing and Administering Cisco Solutions

Some switches can perform Layer 3 functions, replacing the need for dedicated routers to
perform basic routing on a network. Layer 3 switches are capable of performing inter-VLAN
routing. Traditionally, a switch makes forwarding decisions by looking at the Layer 2 header,
whereas a router makes forwarding decisions by looking at the Layer 3 header. A Layer 3 switch
combines the functionality of a switch and a router in one device. It switches traffic when the
source and destination are in the same VLAN and routes traffic when the source and destination
are in different VLANs (that is, on different IP subnets). To enable a Layer 3 switch to perform
routing functions, you must properly configure VLAN interfaces on the switch; these are called
switch virtual interfaces (SVIs). You must use the IP addresses that match the subnet that the
VLAN is associated with on the network. The Layer 3 switch must also have IP routing enabled.
Devices on the VLANs have their default gateway set to the appropriate Layer 3 switch IP
address.

Layer 3 switching is more scalable than router on a stick because the latter can pass only so
much traffic through the trunk link. In general, a Layer 3 switch is primarily a Layer 2 device that
has been upgraded to have some routing capabilities. A router is a Layer 3 device that can

https://ondemandelearning.cisco.com/cisco-cte/ccna10/sections/16/pages/3 7/9
3/26/2020 Options for Inter-VLAN Routing | Implementing and Administering Cisco Solutions

perform some switching functions. Layer 3 switches do not have WAN interfaces, while routers
do. Typically, routers also support more advanced Layer 3 features (for example, Network
Address Translation, encryption, and tunneling) than Layer 3 switches.

However, the line between switches and routers becomes hazier every day. Some Layer 2
switches support limited Layer 3 functionality, such as static routing on SVIs, so you can configure
static routes, but routing protocols are not supported.

Following is an example configuration on the Layer 3 switch with personal computers (PCs) that
are connected to VLAN 10 and VLAN 20. PCs in VLAN 10 will have default gateway 10.1.10.1,
and PCs in VLAN 20 will have default gateway 10.1.20.1. The Layer 3 switch will perform routing
between VLAN 10 and VLAN 20.

ip routing
!
interface Vlan10
ip address 10.1.10.1 255.255.255.0
no shutdown
!
interface Vlan20
ip address 10.1.20.1 255.255.255.0
no shutdown

Content Review Question

Which inter-VLAN routing solution is used in the example below?

interface Fastethernet0/0.10 encapsulation dot1q 10 ip address


10.1.10.1 255.255.255.0 no shutdown ! interface Fastethernet0/0.20
encapsulation dot1q 20 ip address 10.1.20.1 255.255.255.0 no shutdown

https://ondemandelearning.cisco.com/cisco-cte/ccna10/sections/16/pages/3 8/9
3/26/2020 Options for Inter-VLAN Routing | Implementing and Administering Cisco Solutions

https://ondemandelearning.cisco.com/cisco-cte/ccna10/sections/16/pages/3 9/9

You might also like