Introduction to Static Routing – Cisco (Free Preview)

This is a preview lesson. Please purchase the course to access all lessons.

Static routes are defined by the network engineer. Static routes cause packets travelling from a source to a destination to take a specific path as defined by the static route.

 

Characteristics of static routes

  • Configuration becomes complex as the network size increases.
  • Topology changes are not dynamically learned. Therefore, requires the intervention of the network engineer to make changes.
  • Much suited for smaller networks.
  • It is lot more secure than dynamic protocols as it is a user defined route rather than a dynamically learned route.
  • Does not require a great deal of CPU, memory and bandwidth.
  • This is a static entry and does not change. Therefore, it is always predictable.

 

When should we use static routes

  1. Smaller networks that are not expected to grow significantly.
  2. Routing to and from stub networks.

Stub Network: A network that does not lead to other networks. It’s non-local traffic are routed via a single path using a default route.

  1. Using a single default route to reach any network that does not have a more specific entry in the routing table.
  2. To create backup links in case a primary route link fails.
  3. When we want to reduce the number of routes advertised by summarizing several contiguous networks as one static route.

 

Figure Stub networks and stub routers

 

In the above example, we can configure static routes on R1 to reach the stub networks 172.16.20.0/24 and 10.10.20.0/24. Also, we can create default static routes on R2 and R3 pointing to R1 as the next hop to reach the upstream networks.

 

Types of Static Routes

  • *Standard static route
  • *Default static route
  • Summary static route
  • Floating Static route

 

* Signifies most commonly used static routes.

 

How to Configure Static Routes

Static routes are configured using the ip route command on a Cisco router.

To establish static routes, use the ip route command in global configuration mode. To remove static routes, use the no form of this command.

 

ip route prefix mask {ip-address | interface-type interface-number } [distance] [permanent]

no ip route prefix mask {ip-address | interface-type interface-number } [distance] [permanent]

 

Syntax Description

prefix IP route prefix for the destination.
mask Prefix mask for the destination.
ip-address IP address of the next hop that can be used to reach that network.
interface-type interface-number Network interface type and interface number.
distance (Optional) An administrative distance. The default administrative distance for a static route is 1.
permanent (Optional) Specifies that the route will not be removed, even if the interface shuts down.

 

 

Let’s configure a static route on R1 to reach network 172.16.20.0/24.

 

Figure Configuring a static route on R1 to reach 172.16.20.0/24

 

R1#configure terminal

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            Virtual 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
!--- This is how the final command should look like ---!

R1(config)#

 

We can write the above command in another way as well

R1(config)#ip route 172.16.20.0 255.255.255.0 Fa0/1

 

Default Routing (Gateway of Last Resort)

 

We use default routes on stub networks.

Stub Network: A network that does not lead to other networks. It’s non-local traffic are routed via a single path using a default route.

 

In the figure below, R3 is a stub router and 172.16.20.0/24 is a stub network.

 

Figure Configuring a gateway of last resort

 

Here are two ways how we can configure a default route.

  1. Using the exit interface to configure the default route
R3(config)#ip route 0.0.0.0 0.0.0.0 Fa0/1

What this is telling is that if the router R3 does not have a specific entry to the destination network in the routing table then just forward the packets out Fa0/1.

 

  1. Using the next hop router ip address to create the default route

We can also write the above command in another way.

R3(config)#ip route 0.0.0.0 0.0.0.0 172.16.10.1

In the next lesson let’s look at how to configure static routes, default routes and verify static routes.

Lesson tags: CCNA, Static Routes
Back to: Practical Network Lessons > Network Lessons - Static Routing