ITNET02 Module 05 InterVLAN Routing
ITNET02 Module 05 InterVLAN Routing
InterVLAN Routing
ITNET02
▪ Configure inter-VLAN routing using the router-on-a-stick and Layer 3 switching methods.
Module References:
▪ CCNAv7 SRWE – Module 4
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 2
4.1 Review of Routing Configuration
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 3
Basic Routing Concepts
The Role of Routers
• Hosts in different logical networks cannot directly exchange data with each other
• A router is needed to forward packets between networks
• To send data out of their own subnet, devices must be configured with a default
gateway address in order to have the router handle packets destined for outside hosts
192.168.1.0/24
192.168.1.254/24
192.168.1.1/24
Gateway 192.168.1.254
192.168.1.2/24
Gateway 192.168.1.254
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 4
Basic Router Configuration
Configure Router Interfaces
• Routers support LANs and WANs and can interconnect different types of networks; therefore,
they support many types of interfaces.
• To be available, an interface must be activated and configured with at least 1 IP address:
Set an IPv6 address and prefix length Router(config-if)# ipv6 address ipv6_addr/prefix
Set the interface description (Optional but good practice) Router(config-if)# description text
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 5
Basic Router Configuration
Configure Router Interfaces (Cont.)
R1
R1(config)# ipv6 unicast-routing
R1(config)# interface G0/0
R1(config-if)# ip address 192.168.1.1 255.255.255.0
R1(config-if)# ipv6 address 2001:db8:acad:1::1/64
R1(config-if)# description Connection to Network A
R1(config-if)# no shutdown
R1(config-if)# interface G0/1
R1(config-if)# ip address 192.168.2.1 255.255.255.0
R1(config-if)# ipv6 address 2001:db8:acad:2::1/64
R1(config-if)# description Connection to Network B
R1(config-if)# no shutdown © 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 6
R1(config-if)# end
Basic Router Configuration
IPv4 Loopback Interfaces
• The loopback interface is a logical interface not assigned to a physical port and can never be
connected to any other device. It is considered a software interface that is automatically placed in
an “up” state, as long as the router is functioning.
• Useful in testing and managing a Cisco IOS device because it ensures that at least one interface
will always be available. E.g. It can be used for testing purposes, such as testing routing processes
by emulating networks behind the router.
• Loopback interfaces are given the interface ID “Loopback” or “Lo” and a number. They are
configured just like any other physical interface.
• Example:
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 7
Verify Directly Connected Networks
Interface Verification Commands
The following commands are useful to quickly identify the status of an interface:
• show ip interface brief and show ipv6 interface brief - Display a summary for all
interfaces including the interface IPv4 or IPv6 address and current operational status.
• .
R1#show ip interface brief
Interface IP-Address OK? Method Status Protocol
GigabitEthernet0/0 192.168.1.1 YES manual up up
GigabitEthernet0/1 192.168.2.1 YES manual up up
Loopback0 192.168.255.1 YES manual up up
R1#show ipv6 interface brief
GigabitEthernet0/0 [up/up]
FE80::201:96FF:FE03:BD01
2001:DB8:ACAD:1::1
GigabitEthernet0/1 [up/up]
FE80::201:96FF:FE03:BD02
2001:DB8:ACAD:2::1
Loopback0 [up/up]
FE80::201:64FF:FEE1:B319
2001:DB8:ACAD:FFFF::1 © 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 8
Verify Directly Connected Networks
Interface Verification Commands
The following commands are useful to quickly identify the status of an interface:
• show ip route and show ipv6 route - Display the contents of the IPv4 or IPv6 routing
table stored in RAM.
R1#show ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
. . .
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 11
Inter-VLAN Routing Operation
What is Inter-VLAN Routing?
• VLANs are used to segment switched Layer 2 networks for a variety of reasons.
• Each VLAN is a unique broadcast domain and IP subnetwork.
• Hosts in one VLAN cannot communicate with hosts in another VLAN unless there is a router or a
Layer 3 switch to provide routing services.
• Inter-VLAN routing is the process of forwarding network traffic from one VLAN to another VLAN.
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 12
Inter-VLAN Routing Operation
Legacy Inter-VLAN Routing
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 13
Inter-VLAN Routing Operation
Legacy Inter-VLAN Routing
Example:
VLAN 10 VLAN 20
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 15
4.3 Router-on-a-Stick
Inter-VLAN Routing
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 16
Inter-VLAN Routing Operation
Router-on-a-Stick Inter-VLAN Routing
• The ‘router-on-a-stick’ inter-VLAN routing
method enables one physical Ethernet interface
to route traffic between multiple VLANs on a
network.
• A router Ethernet interface is configured as an
802.1Q trunk and connected to a trunk port on
a Layer 2 switch.
• The router interface is logically divided into
subinterfaces, each assigned to a routable
VLAN.
• The configured subinterfaces are software-
based virtual interfaces.
• Each subinterface is independently
configured with a VLAN assignment and an
IP address corresponding to the subnet of
their VLAN
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 17
Inter-VLAN Routing Operation
Router-on-a-Stick Inter-VLAN Routing
• Since the link to the router is a trunk, traffic
entering the router will remain tagged with the
VLAN ID of the sending host
• When VLAN-tagged traffic enters the router
interface, it is forwarded to the VLAN
subinterface.
802.1q-tagged frames
• After a routing decision is made based on the
destination IP network address, the router
determines the exit interface for the traffic.
• If the exit interface is configured as an 802.1q
subinterface, the data frames are VLAN-tagged
with the new VLAN and sent back out the
physical interface
• Note: The router-on-a-stick method of inter-
VLAN routing does not scale beyond 50 VLANs.
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 18
Inter-VLAN Routing Configuration
Router-on-a-Stick Configuration Procedure
To configure inter-VLAN routing using the router-on-a-stick method:
• Step 1. Set the switch interface to trunk mode
• Step 2. Create and configure subinterfaces on the router
Subinterface VLAN IP Address
G0/0/1.10 10 192.168.10.1/24
G0/0/1.20 20 192.168.20.1/24
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 19
Inter-VLAN Routing Configuration
Router Subinterface Configuration
• Step 2. Create and configure subinterfaces on the router
Task IOS Command
Enter interface configurations mode on the physical interface Router(config)# interface interface-id
• Notes:
• Manually activating/deactivating the main interface automatically activates / deactivates all its subinterfaces
• Subinterfaces may be individually enabled / disabled, but the main physical interface must be enabled for
any of its subinterfaces to be active
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 20
Inter-VLAN Routing Configuration
Router Subinterface Configuration
• Step 2. Create and configure subinterfaces on the router
Subinterface VLAN IP Address
G0/0/0.10 10 192.168.10.1/24
R1(config)# interface G0/0/0
R1(config-if)# no shutdown G0/0/0.20 20 192.168.20.1/24
R1(config-if)# interface G0/0/0.10
R1(config-subif)# encapsulation dot1q 10
R1(config-subif)# ip address 192.168.10.1 255.255.255.0
R1(config-if)# interface G0/0/0.20
R1(config-subif)# encapsulation dot1q 20
R1(config-subif)# ip address 192.168.20.1 255.255.255.0
R1(config-subif)#end
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 21
Router-on-a-Stick Inter-VLAN Routing
Router-on-a-Stick Inter-VLAN Routing Verification
The show interface, show ip interface brief and show ip route commands can
be used to verify and troubleshoot the router-on-a-stick configuration.
R1#show ip interface brief
Interface IP-Address OK? Method Status Protocol
GigabitEthernet0/0/0 none YES manual up up
GigabitEthernet0/0/0.10 192.168.10.1 YES manual up up
GigabitEthernet0/0/0.20 192.168.20.1 YES manual up up
GigabitEthernet0/0/1 none YES manual administratively down administratively do
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 22
Router-on-a-Stick Inter-VLAN Routing
Router-on-a-Stick Inter-VLAN Routing Verification
The show interface, show ip interface brief and show ip route commands can
be used to verify and troubleshoot the router-on-a-stick configuration.
R1#show ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
. . .
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 23
4.4 Inter-VLAN Routing using
Layer 3 Switches
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 24
Inter-VLAN Routing Operation
Inter-VLAN Routing on a Layer 3 Switch
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 25
Inter-VLAN Routing using Layer 3 Switches
Layer 3 Switch Inter-VLAN Routing
• Enterprise campus LANs use Layer 3 switches
instead of routers to provide inter-VLAN routing
and commonly place them in the distribution layer.
• Layer 3 switches use specialized hardware-based
switching processors to achieve higher-packet
processing rates than routers.
• Capabilities of a Layer 3 switch include following:
• Route from one VLAN to another using multiple
switched virtual interfaces (SVIs).
• Convert a Layer 2 switchport to a Layer 3 interface
(i.e., a routed port). A routed port is similar to a
physical interface on a Cisco IOS router.
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 26
Inter-VLAN Routing Operation
Benefits of Inter-VLAN Routing on a Layer 3 Switch
• Advantages:
• No need for external links from the switch
to the router for routing.
• Not limited to one link because aggregated
trunk links can be used to link switches for
increased bandwidth.
• Latency is much lower because data does
not need to leave the switch in order to be
routed to a different network.
• Much faster than router-on-a-stick because
everything is hardware switched and
routed.
F0/1 F0/3
F0/2 F0/4
192.168.10.11 192.168.20.11
VLAN 10 VLAN 20
Default gateway: Default gateway:
192.168.10.1 192.168.20.1
192.168.10.12 192.168.20.12
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 28
Inter-VLAN Routing using Layer 3 Switches S1(config)# interface vlan 10
Layer 3 Switch Configuration S1(config-if)# ip address 192.168.10.1 255.255.255.0
S1(config-if)# no shutdown
Procedure to configure L3 S1(config)# interface vlan 20
S1(config-if)# ip address 192.168.20.1 255.255.255.0
switching: S1(config-if)# no shutdown
S1(config-if)# exit
• Step 1. Create the VLANs and S1(config)# ip routing
assign access ports
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 30
Inter-VLAN Routing using Layer 3 Switches
Layer 3 Switch Inter-VLAN Routing Verification
The show ip route command can be used to verify the routing status of the
switch.
S1#show ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
* - candidate default, U - per-user static route, o - ODR
P - periodic downloaded static route
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 31
4.4 Troubleshoot Inter-VLAN
Routing
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 32
Troubleshoot Inter-VLAN Routing
Common Inter-VLAN Issues
There are a number of reasons why an inter-VAN configuration may not work. All of them will manifest as
connectivity issues between hosts in the network.
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 33
Troubleshoot Inter-VLAN Routing
Troubleshoot Inter-VLAN Routing Scenario
Router R1 Subinterfaces
G0/0/0.10 10 192.168.10.1/24
G0/0/0.20 20 192.168.20.1/24
G0/0/0.30 99 192.168.99.1/24
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 34
Troubleshoot Inter-VLAN Routing
Missing VLANs
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 35
Troubleshoot Inter-VLAN Routing
Switch Trunk Port Issues
• Another issue for inter-VLAN routing includes misconfigured switch ports.
• In a legacy inter-VLAN solution, this could be caused when the port connected to the router is not set
as an access port or is not assigned to the correct VLAN.
• In a router-on-a-stick solution, the most common cause is a misconfigured trunk port.
• To verify: show interface trunk
S1#show interface trunk
Port Mode Encapsulation Status Native vlan
Fa0/1 on 802.1q trunking 1
Switch#
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 36
Troubleshoot Inter-VLAN Routing
Router Configuration Issues
• Router-on-a-stick configuration problems are usually related to subinterface
misconfigurations.
• To verify subinterface status: show ip interface brief
• To verify VLANs assignment: show interfaces - Optionally use the include keyword to filter
output and show only line containing the physical interface ID and “802.1Q”
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 37
Troubleshoot Inter-VLAN Routing
Default Gateway Configuration Issues
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 38
Questions?
Module Summary
What You Learned In This Module
• Inter-VLAN routing is the process of forwarding network traffic from one VLAN to another
VLAN.
• Three options include legacy, router-on-a-stick, and Layer 3 switch using SVIs.
• The legacy method
• Requires an access connection from the switch to the router for each VLAN
• Requires a physical interface per VLAN from the router to serve as gateway
• The router-on-a-stick method
• Requires a trunk connection from the switch to the router
• Requires a subinterface to be created for each VLAN to be routed.
• Each router subinterface must be assigned an IP address on a unique subnet for routing to
occur.
• Recommended for small to medium sized networks
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 40
Module Summary
What You Learned In This Module
• Inter-VLAN routing is the process of forwarding network traffic from one VLAN to another
VLAN.
• Three options include legacy, router-on-a-stick, and Layer 3 switch using SVIs.
• The L3 switching method
• Uses switches that capable of routing packets using hardware-based switching to achieve
higher-packet processing rates than routers.
• Layer 3 switches can route from one VLAN to another using multiple switched virtual
interfaces (SVIs) and converting a Layer 2 switchport to a Layer 3 interface (i.e. a routed
port).
• Recommended for enterprise campus networks
• Common causes of errors in interVLAN routing are: missing VLANs, misconfigured port
modes, incorrect routing interface IP address / VLAN assignment and incorrect host default
gateway settings
© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 41