Configuring Router on a Stick


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

  • 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#