Free CCNA Workbook
  • Home
  • About
    • Donations
    • Free CCNA Workbook Staff
  • Blog
  • Workbooks
    • CCNA Routing & Switching
    • CCNA Security
    • CCNA Voice
    • CCNA Wireless
  • Stub Lab
    • Stub Lab Information
    • Stub Lab FAQ’s
    • Stub Lab Topology

Configuring Router on a Stick

Router on a Stick is an uncommon configuration however you must understand the technology concepts to become a great network engineer. This lab will discuss and demonstrate the configuration and verification of inter-vlan routing known as Router on a Stick.

Real World Application & Core Knowledge

The only way to get off a layer two network segment is through a layer three device; commonly referred to as a Default Gateway for host machines. So let’s say for example you have a single switch with 5 different VLAN’s and machines on each VLAN; in which case each VLAN would require its own router to get out of that layer two network to a different layer two network. So does this mean that multiple routers are required or a router with 5 physical ethernet interfaces, one interface in each VLAN?

The answer is easier then you’d initially think. In this case you only need a SINGLE router and that’s it. Think back to the previous lab discussing Dot1q trunk interfaces. 802.1q trunk interfaces carry all VLAN traffic.

A single Router can utilize an 802.1q trunk link to place a sub-interface in each VLAN using a single physical link and technically have interfaces in all VLAN’s.

A Sub-Interface is a logical interface partitioned off from a physical interface. A sub-interface allows you to have multiple interface configurations on a single physical interface. In this lab you’ll use sub-interfaces to match the VLAN’s in the trunk to allow for interfaces in each VLAN and accomplish inter-vlan routing for the hosts as the router has an interface in each layer three network.

In this lab you’ll familiarize yourself with the following new commands;

Command Description
encapsulation dot1Q # This command is executed from ethernet sub-interface configuration mode and binds the sub interface(s) to a particular 802.1q tagged vlan.
no ip routing This command is executed from global configuration and disables the routers ability to be used as a router, effectively turning it into a test client machine like a windows box.
ip default-gateway 1.2.3.4 This command is executed in global configuration mode to configure a non-routing device to use the specific IP Address as a default-gateway.
show ip interface brief This command can be executed from user or privileged mode to view the current IP addresses of all interfaces on the device.

Lab Prerequisites

  • If you are using GNS3 than load the Free CCNA Workbook GNS3 topology than start devices; R1, R2, R3 and SW1.
  • Establish a console session with devices R1, R2, R3 and SW1 than configure the devices respected hostname(s).
  • Create VLAN’s 20 and 30 on SW1 and configure interface Fa0/1 on SW1 as an 802.1q trunk link.
  • On SW1 configure interface Fa0/2 to access VLAN20 and Fa0/3 to access VLAN 30.
  • Configure the IP address 10.1.20.2/24 on R2’s FastEthernet0/0 interface.
  • Configure the IP address 10.1.30.3/24 on R3’s Fastethernet0/0 interface.

Lab Objectives

  • Configure a new Sub-Interface on R1 to match the VLAN 20 (Fa0/0.20) and configure the sub-interface to use 802.1q encapsulation and the Dot1q tag of 20. Configure the sub-interface to use the IP address 10.1.20.1/24.
  • Configure a new Sub-Interface on R1 to match the VLAN 30 (Fa0/0.30) and configure the sub-interface to use 802.1q encapsulation and the Dot1q tag of 30. Configure the sub-interface to use the IP address 10.1.30.1/24. Verify your sub-interface configuration.
  • Disable IP Routing on R2 and R3 and configure the default gateway on R2 and R3 to use R1’s respected Sub-interface as the default gateway.
  • Verify that R2 can ping R3’s FastEthernet0/0 interface using R1 as the default-gateway.

Lab Instruction

Step 1. – Configure a new Sub-Interface on R1 to match the VLAN 20 (Fa0/0.20) and configure the sub-interface to use 802.1q encapsulation and the Dot1q tag of 20. Configure the sub-interface to use the IP address 10.1.20.1/24.

To create a new sub-interface you’ll use the interface fa0/0.# command in global configuration mode. To enable the sub-interface to use 802.1q you’ll use the encapsulation dot1q # command whereas # is the dot1q VLAN tag as shown below;

R1 con0 is now available



Press RETURN to get started.



R1>enable
R1#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
R1(config)#interface fa0/0
R1(config-if)#no shut
R1(config-if)#interface fa0/0.20
R1(config-subif)#encapsulation dot1q 20
R1(config-subif)#ip add 10.1.20.1 255.255.255.0
R1(config-subif)#exit
R1(config)#

Step 2. – Configure a new Sub-Interface on R1 to match the VLAN 30 (Fa0/0.30) and configure the sub-interface to use 802.1q encapsulation and the Dot1q tag of 30. Configure the sub-interface to use the IP address 10.1.30.1/24. Verify your sub-interface configuration.

R1(config)#interface fa0/0.30
R1(config-subif)#encapsulation dot1q 30
R1(config-subif)#ip add 10.1.30.1 255.255.255.0
R1(config-subif)#end
R1#sh run interface fa0/0.20
Building configuration...

Current configuration : 96 bytes
!
interface FastEthernet0/0.20
 encapsulation dot1Q 20
 ip address 10.1.20.1 255.255.255.0
end

R1#sh run interface fa0/0.30
Building configuration...

Current configuration : 96 bytes
!
interface FastEthernet0/0.30
 encapsulation dot1Q 30
 ip address 10.1.30.1 255.255.255.0
end

R1#show ip interface brief | inc FastEthernet0/0
Interface               IP-Address    OK? Method   Status     Protocol
FastEthernet0/0         unassigned    YES unset    up         up
FastEthernet0/0.20      10.1.20.1     YES manual   up         up
FastEthernet0/0.30      10.1.30.1     YES manual   up         up
R1#

Step 3. – Disable IP Routing on R2 and R3 and configure the default gateway on R2 and R3 to use R1’s respected Sub-interface as the default gateway.

To disable IP Routing on R2 and R3 use the no ip routing command in global configuration. To specify a default gateway use the ip default-gateway x.x.x.x as shown below;

R2 con0 is now available



Press RETURN to get started.



R2>enable
R2#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
R2(config)#no ip routing
R2(config)#ip default-gateway 10.1.20.1
R2(config)#end
R2#
R3 con0 is now available



Press RETURN to get started.



R3>enable
R3#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
R3(config)#no ip routing
R3(config)#ip default-gateway 10.1.30.1
R3(config)#end
R3#

Step 4. – Verify that R2 can ping R3’s FastEthernet0/0 interface using R1 as the default-gateway as shown below;

R2#ping 10.1.30.3

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.1.30.3, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 8/23/52 ms
R2#
◄ Previous Lab
Next Lab ►

About Free CCNA Workbook

In 2008 Free CCNA Workbook originally started as a sharable PDF but quickly evolved into the largest CCNA training lab website on the net!

 

The website was founded in late 2009 with the goal of providing FREE Cisco CCNA labs that can be completed using the GNS3 platform.

Latest Tweets

  • 9 years ago The @fccnawb website is not only available in HTTPS. We've done this of course to make Google happy lol.
  • 10 years ago Interested in following the Founder of the Free CCNA Workbook website? Check out @MattGeorgeCCIE

Useful Links

  • Stub Lab GNS3 Topology File Download
  • GNS3 - Cisco Device Emulator Download
  • Geek Fluent Blog by Dave Henry
  • Junos Workbook | Free Juniper JNCIA Training
  • Putty Terminal Emulator (Free Download)
  • Quiz Me! - CCNA R&S Practice Exam

© Copyright 2009-2017 Free CCNA Workbook All Rights Reserved.

Legal | Privacy Policy | Sitemap | Contact Us

sponsored