Configuring Static Routing Using GNS3 (Free Preview)

You must first complete Introduction to Static Routing – Cisco before viewing this Lesson
This is a preview lesson. Please purchase the course to access all lessons.

In this demonstration we are going to examine the following topics.

  • Configuring a static route on router R1 to reach network 172.16.20.0/24
  • Configuring a default route on router R2 to reach any network that’s not found in its routing table
  • Verifying static route configuration

 

Below is the GNS3 LAB setup.

 

Figure Lab Diagram

 

Network Interface Connections

Device Interface IPv4 Address Device Interface IPv4 Address
R1 lo 0 10.0.0.1/8
R1 F0/1 172.16.10.1/24 R3 F0/1 172.16.10.3/24
R1 lo 1 192.168.1.1/24
R3 lo 0 172.16.20.10/24
R3 F0/1 172.16.10.3/24 R1 F0/1 172.16.10.1/24

 

R1 interface configuration & pre-change verification

 

!--- R1 interface configuration ---!

R1#
R1#show ip int brief
Interface                  IP-Address      OK? Method Status                Protocol
FastEthernet0/0            unassigned      YES unset  administratively down down    
Serial0/0                  unassigned      YES unset  administratively down down    
FastEthernet0/1            unassigned      YES unset  administratively down down    
Serial0/1                  unassigned      YES unset  administratively down down    
R1#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
R1(config)#interface fa0/1
R1(config-if)#description TO_R3
R1(config-if)#ip address 172.16.10.1 255.255.255.0
R1(config-if)#no shut
!--- R1 Fa0/1 configuration ---!

R1(config-if)#int lo0
R1(config-if)#
*Mar  1 00:01:48.523: %LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback0, changed state to up
R1(config-if)#ip address 10.0.0.1 255.0.0.0
R1(config-if)#exit
!--- R1 lo0 configuration ---!

R1(config)#^Z
R1#
*Mar  1 00:02:09.719: %SYS-5-CONFIG_I: Configured from console by console


!--- R1 pre-change verification ---!

R1#show ip int brief
Interface                  IP-Address      OK? Method Status                Protocol
FastEthernet0/0            unassigned      YES unset  administratively down down    
Serial0/0                  unassigned      YES unset  administratively down down    
FastEthernet0/1            172.16.10.1     YES manual up                    up      
Serial0/1                  unassigned      YES unset  administratively down down    
Loopback0                  10.0.0.1        YES manual up                    up      


R1#show ip route
Codes: C - connected, S - static, 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
       i - IS-IS, su - IS-IS summary, 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

Gateway of last resort is not set

     172.16.0.0/24 is subnetted, 1 subnets
C       172.16.10.0 is directly connected, FastEthernet0/1
C    10.0.0.0/8 is directly connected, Loopback0

!--- We can see that there are only two routes for the connected interfaces. We will configure lo1 later  ---!

 

 

R3 interface configuration & pre-change verification

 

!--- R3 interface configuration ---!

R3#show ip interface brief
Interface                  IP-Address      OK? Method Status                Protocol
FastEthernet0/0            unassigned      YES unset  administratively down down    
Serial0/0                  unassigned      YES unset  administratively down down    
FastEthernet0/1            unassigned      YES unset  administratively down down    
Serial0/1                  unassigned      YES unset  administratively down down    
R3#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
R3(config)#interface fa0/1
R3(config-if)#ip address 172.16.10.3 255.255.255.0
R3(config-if)#description TO_R1
R3(config-if)#no shut
!--- R3 Fa0/1 configuration ---!

R3(config-if)#int lo0
R3(config-if)#ip address 172.16.20.10 255.255.255.0
R3(config-if)#end
!--- R3 lo0 configuration ---!

R3#
*Mar  1 00:03:28.947: %SYS-5-CONFIG_I: Configured from console by console
R3#show ip int brief
Interface                  IP-Address      OK? Method Status                Protocol
FastEthernet0/0            unassigned      YES unset  administratively down down    
Serial0/0                  unassigned      YES unset  administratively down down    
FastEthernet0/1            172.16.10.3     YES manual up                    up      
Serial0/1                  unassigned      YES unset  administratively down down    
Loopback0                  172.16.20.10    YES manual up                    up      


!--- R3 pre-change verification ---!
R3#ping 172.16.10.1

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.10.1, timeout is 2 seconds:
.!!!!
Success rate is 80 percent (4/5), round-trip min/avg/max = 16/39/80 ms
!--- We can successfully ping R1s' Fa0/1 ---!

R3#show ip route
Codes: C - connected, S - static, 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
       i - IS-IS, su - IS-IS summary, 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

Gateway of last resort is not set

     172.16.0.0/24 is subnetted, 2 subnets
C       172.16.20.0 is directly connected, Loopback0
C       172.16.10.0 is directly connected, FastEthernet0/1

!--- There are only two routes for the connected interfaces.  ---!

 

Lets see whether we can ping 172.16.20.10 from R1.

R1#ping 172.16.20.10

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.20.10, timeout is 2 seconds:
.....
Success rate is 0 percent (0/5)

!--- Well we should not be too surprised about it. The ping failed because R1 does not know how to reach 172.16.20.0/24 ---!

 

 

R1 Static Route Configuration

Let’s teach R1 how to reach 172.16.20.0/24 by adding a standard static route.


!--- R1 Static Route Configuration ---!

R1#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
R1(config)#ip route ?
  A.B.C.D  Destination prefix
  profile  Enable IP routing table profile
  static   Allow static routes
  vrf      Configure static route for a VPN Routing/Forwarding instance

R1(config)#ip route 172.16.20.0 ?
  A.B.C.D  Destination prefix mask

R1(config)#ip route 172.16.20.0 255.255.255.0 ?
  A.B.C.D            Forwarding router's address
  Async              Async interface
  BVI                Bridge-Group Virtual Interface
  CDMA-Ix            CDMA Ix interface
  CTunnel            CTunnel interface
  DHCP               Default Gateway obtained from DHCP
  Dialer             Dialer interface
  FastEthernet       FastEthernet IEEE 802.3
  Lex                Lex interface
  Loopback           Loopback interface
  MFR                Multilink Frame Relay bundle interface
  Multilink          Multilink-group interface
  Null               Null interface
  Port-channel       Ethernet Channel of interfaces
  Serial             Serial
  Tunnel             Tunnel interface
  Vif                PGM Multicast Host interface
  Virtual-PPP        Virtual PPP interface
  Virtual-TokenRing  Virtual TokenRing
  XTagATM            Extended Tag ATM interface
  vmi                Virtual Multipoint Interface

R1(config)#ip route 172.16.20.0 255.255.255.0 172.16.10.3
!--- Configures a static route to 172.16.20.0/24 using the next-hop address 172.16.10.3 ---!
!--- Read this to say: To get to the destination network of 172.16.20.0, with a subnet mask of 255.255.255.0, send all packets to 172.16.10.3 ---!

R1(config)#end


!--- R1 post change verification ---!
*Mar  1 00:07:11.039: %SYS-5-CONFIG_I: Configured from console by console
R1#show ip route
Codes: C - connected, S - static, 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
       i - IS-IS, su - IS-IS summary, 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

Gateway of last resort is not set

     172.16.0.0/24 is subnetted, 2 subnets
S       172.16.20.0 [1/0] via 172.16.10.3
C       172.16.10.0 is directly connected, FastEthernet0/1
C    10.0.0.0/8 is directly connected, Loopback0
!--- "S" signifies this is a static route. The 1 here "[1/0]" signifies that the administrative distance is 1. ---!


R1#ping 172.16.20.10

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.20.10, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 16/21/28 ms
!--- Now we have a route to 172.16.20.0/24. Therefore our ping is successful ---!
!--- What happens when we source the ping packets from the lo0 ip address ---!
R1#ping 172.16.20.10 source lo0

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.20.10, timeout is 2 seconds:
Packet sent with a source address of 10.0.0.1 
.....
Success rate is 0 percent (0/5)
!--- The ping is unsuccessful, because once the ping echo request reaches R3, it does not know how to send the echo reply to 10.0.0.1. ---! 
!--- R3 does not have any knowledge of how to reach 10.0.0.1. It only knows about its connected interface. ---!
!--- Then why does ping to 172.16.20.10 was successful? That's because the ping was sourced from the R1s' Fa0/1 which is 172.16.10.1. R3 has one of its own interfaces in this network. ---!

R3 Default Route Configuration

!--- R3 configuration ---!
R3#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
R3(config)#ip route 0.0.0.0 0.0.0.0 ?
  A.B.C.D            Forwarding router's address
  Async              Async interface
  BVI                Bridge-Group Virtual Interface
  CDMA-Ix            CDMA Ix interface
  CTunnel            CTunnel interface
  DHCP               Default Gateway obtained from DHCP
  Dialer             Dialer interface
  FastEthernet       FastEthernet IEEE 802.3
  Lex                Lex interface
  Loopback           Loopback interface
  MFR                Multilink Frame Relay bundle interface
  Multilink          Multilink-group interface
  Null               Null interface
  Port-channel       Ethernet Channel of interfaces
  Serial             Serial
  Tunnel             Tunnel interface
  Vif                PGM Multicast Host interface
  Virtual-PPP        Virtual PPP interface
  Virtual-TokenRing  Virtual TokenRing
  XTagATM            Extended Tag ATM interface
  vmi                Virtual Multipoint Interface

R3(config)#ip route 0.0.0.0 0.0.0.0 fa0/1
!--- Read this to say: Send all packets destined for networks not in my routing table out my Fa0/1 interface ---!

R3(config)#end
R3#
*Mar  1 00:10:57.647: %SYS-5-CONFIG_I: Configured from console by console


!--- R3 post change verification ---!

R3#show ip route
Codes: C - connected, S - static, 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
       i - IS-IS, su - IS-IS summary, 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

Gateway of last resort is 0.0.0.0 to network 0.0.0.0

     172.16.0.0/24 is subnetted, 2 subnets
C       172.16.20.0 is directly connected, Loopback0
C       172.16.10.0 is directly connected, FastEthernet0/1
S*   0.0.0.0/0 is directly connected, FastEthernet0/1
!--- S* indicates this entry is a candidate for a default route. ---!


R3#ping 10.0.0.1 source lo0

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.0.0.1, timeout is 2 seconds:
Packet sent with a source address of 172.16.20.10 
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 12/18/24 ms
R3#


R1#ping 172.16.20.10 source lo0

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.20.10, timeout is 2 seconds:
Packet sent with a source address of 10.0.0.1 
.!!!!
Success rate is 80 percent (4/5), round-trip min/avg/max = 20/23/32 ms
!--- Now the ping from R1 lo0 is successful. ---!

 

 

Finally let’s create lo1 on R1 and examine how the default route behave?

!--- R1 lo1 configuration ---!

R1#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
R1(config)#interface lo1
R1(config-if)#ip address 192.168.10.1 255.255.255.0
R1(config-if)#exit
R1(config)#exit

R1#show ip int brief
Interface                  IP-Address      OK? Method Status                Protocol
FastEthernet0/0            unassigned      YES unset  administratively down down    
Serial0/0                  unassigned      YES unset  administratively down down    
FastEthernet0/1            172.16.10.1     YES manual up                    up      
Serial0/1                  unassigned      YES unset  administratively down down    
Loopback0                  10.0.0.1        YES manual up                    up      
Loopback1                  192.168.10.1    YES manual up                    up      

R1#show ip route
Codes: C - connected, S - static, 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
       i - IS-IS, su - IS-IS summary, 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

Gateway of last resort is not set

C    192.168.10.0/24 is directly connected, Loopback1
     172.16.0.0/24 is subnetted, 2 subnets
S       172.16.20.0 [1/0] via 172.16.10.3
C       172.16.10.0 is directly connected, FastEthernet0/1
C    10.0.0.0/8 is directly connected, Loopback0


R1#ping 172.16.20.10 source lo1

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.20.10, timeout is 2 seconds:
Packet sent with a source address of 192.168.10.1 
.!!!!
Success rate is 80 percent (4/5), round-trip min/avg/max = 20/22/24 ms
!--- We do not have to create additional static route statements on R3 because of the default route. ---!
Lesson tags: CCNA, Cisco, GNS3, Routing, Static Routes
Back to: Practical Network Lessons > Network Lessons - Static Routing