How to Configure Static Routing on a Cisco router

By | March 16, 2014

Hi, so far we were discussing about Cisco networking. In this tutorial I’m gonna to teach you about How to configure Static Routing in Cisco router.
A static route is a manually configured route on router’s routing table. Usually static routing is employed with smaller network because Administrator should update routing table manually. One of the major drawbacks of static routing protocol is that manual configuration needed when new network added or removed from the existing network. So static routing protocol used only used in smaller networks.
Static routing is the most basic form of routing. If the router has been configured as a static router, the network administrator is responsible for adding network entries into the routing table of each router. Hence the complexity and effort increases while the network grows.

How to Configure Static Routing

You must know
All Cisco routers have the routing capability turned ON by default. The command responsible for this is:

router(config)#ip routing

For disabling routing capability use

router(config)#no ip routing

NB: This command is usually used on low-end routers only

Metric

Metric and Administrative Distance are the parameters having more importance in Routing. Metric is used by a Routing protocol to select best path if there are two or more paths are available. Metrics involve a single routing protocol. They have zero validity with multiple sources for routes.

Administrative Distance (AD)

Cisco static route administrative distance is 1. Administrative Distance (AD) is a value that routers used to select the best path when there are two or more different routes to the same destination from two different routing protocols.

Administrative Distance counts the reliability of a routing protocol.

For example if a Router learn a route by RIP and the same route already configured via Static route, router may consider only the static route. Because administrative distance of RIP is 120, whereas Static route is 1 by default (Administrator can alter it manually).

Smaller the value of Administrative distance better will be the route.

These two factors usually bit confusing. Are you get confused? I will be sharing an article about “Difference between Metric and Administrative Distance” Keep in touch.

Static Routing Benefits

For every routing protocols, there are some advantages and disadvantages. Here let me discuss some static routing advantages.

  • No overhead for CPU of Routers: – Administrators hard codes the routing table, so no processing is required to choose paths.
  • Easy to configure: – If you have a small network and no plan to grow, It is very easy to configure with static route in those routers, as you already aware about network structure and systems.
  • Security: – Since Administrator defining the routing table, there is no possibility for incorrect route in the routing table without the knowledge of Admin.

Drawbacks of Static Routing in Cisco

  • Applicable to small networks: – Suitable to small networks only. For larger networks maintaining with static route will be a full time job as itself.
  • Manual Process and time consuming: – While adding or removing new networks from existing one required manual configuration at each routers.

Uses of Static Routing

Some of the situation we should go for Static routing.

  • Smaller networks those have no plan to grow more in future.
  • Quick configuration: – When you need to make a route from one to another router for a small duration (testing purpose or any) without exchanging all routing information to neighboring router.
  • To specify an exit path from a router if no further routes are available. This is called a default route.

These are the preliminary knowledge before getting in to Static Routing. Now it’s time to go to Cisco router configuration with Static Routing.

Have you missed my previous article? Read: – Static routing and dynamic routing

How to Configure Static Routing in Cisco Router

Static route is easy to configure, let’s take an example topology that we discussed in previous article. Here I’m going to configure static routing between 2 routers (Router 1 and Router 2).

Static Routing command syntax: (Using Next hop IP)

Router(config)#ip route [Destination Network ID] [Subnet Mask] [Next hop ip]

Static Routing command syntax:(Using Exit Interface)

Router(config)#ip route [Destination Network ID] [Subnet Mask] [Exit interface name]

Both of the commands gives same result, second one is used when the admin don’t know Next hop IP.

Router 1 information

Interface IP Subnet Connected to
Fast Ethernet 0/0 10.0.0.1 255.0.0.0 Network 1
Ethernet 1/0 20.0.0.1 255.0.0.0 Network 2
Serial 40.0.0.2 255.0.0.0 Router 2 (Network 4)

Static Routing using Next hop IP in Router 1

Without any configuration Network 1 and Network 2 can communicate each other. Below figure shows routing table of Router 1.
Routing Table of Router 1
Routing table reviles that there is no information regarding Network 3 (30.0.0.0/8). So we should update Network 3 manually in the routing table of Router 1.

Let’s start static routing Cisco packet tracer. 1st step is to assign IP address for each ports in Router 1.

Router 1 configuration

Router>enable
Router#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#hostname R1
R1(config)#interface fastEthernet 0/0
R1(config-if)#ip address 10.0.0.1 255.0.0.0
R1(config-if)#no shutdown

%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up

R1(config-if)#
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up

R1(config-if)#exit
R1(config)#interface ethernet 1/0
R1(config-if)#ip address 20.0.0.1 255.0.0.0
R1(config-if)#no shutdown

%LINK-5-CHANGED: Interface Ethernet1/0, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface Ethernet1/0, changed state to up

R1(config-if)#exit
R1(config)#interface serial 0/0
R1(config)#clock rate 64000
R1(config-if)#ip address 40.0.0.2 255.0.0.0
R1(config-if)#no shutdown

%LINK-5-CHANGED: Interface Serial0/0, changed state to down
R1(config-if)#
R1(config-if)#
R1#
%SYS-5-CONFIG_I: Configured from console by console
R1#

The above configuration is assigning IP to each port. The following is static routing destination IP format.

R1#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
R1(config)#ip route 30.0.0.0 255.0.0.0 40.0.0.1
R1(config)#exit
R1#
%SYS-5-CONFIG_I: Configured from console by console

R1#copy running-config startup-config
Destination filename [startup-config]?
Building configuration...
[OK]
R1#exit

Now the updated routing table of Router 1 is
Static Routing Table of Router 1

Cisco Static Routing Using Exit Interface

Instead of next hop IP, there is another static routing syntax for Cisco routers. This is called Cisco static route using interface.

Instead of the following command line in the configuration

R1(config)#ip route 30.0.0.0 255.0.0.0 40.0.0.1

We can also use

R1(config)#ip route 30.0.0.0 255.0.0.0 serial 0/0

Static Routing using Exit interface in Router 1

Here Serial 0/0 is the exit interface of Router 1

Cisco static route via interface gives updated static routing table like the following
Static Routing Table of Router 1 with exit interface

Router 2 Information

Interface IP Subnet Connected to
Fast Ethernet 0/0 30.0.0.1 255.0.0.0 Network 3
Serial 0/0 40.0.0.1 255.0.0.0 Router 1 (Network 4)

Static Routing using Next hop IP in Router 2

Below figure shows routing table of Router 1.
Routing Table of Router 2
Routing table shows that there is no information regarding Network 1 (10.0.0.0) and Network 2 (20.0.0.0). So we should update Network 1 & 2 manually in the routing table of Router 2.

Router 2 Configuration

Router>
Router>enable
Router#conf terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#hostname R2
R2(config)#interface fastEthernet 0/0
R2(config-if)#ip address 30.0.0.1 255.0.0.0
R2(config-if)#no shutdown

%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up

R2(config-if)#exit
R2(config)#
R2(config)#interface serial 0/0
R2(config)#clock rate 64000
R2(config-if)#ip address 40.0.0.1 255.0.0.0
R2(config-if)#no shutdown

%LINK-5-CHANGED: Interface Serial0/0, changed state to up

R2(config-if)#exit
R2(config)#
%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0, changed state to up
R2#
%SYS-5-CONFIG_I: Configured from console by console

The above configuration is assigning IP to the router 2 ports. The following is Static routing command.

R2#conf terminal
Enter configuration commands, one per line. End with CNTL/Z.
R2(config)#ip route 10.0.0.0 255.0.0.0 40.0.0.2
R2(config)#ip route 20.0.0.0 255.0.0.0 40.0.0.2
R2(config)#exit
R2#
%SYS-5-CONFIG_I: Configured from console by console

R2#

R2#copy running-config startup-config
Destination filename [startup-config]?
Building configuration...
[OK]
R2#exit

The updated Routing table of Router 2 is
Static Routing Table of Router 1

Static Routing Using Exit Interface

Instead of the following lines in the configuration of Router 2

R2(config)#ip route 10.0.0.0 255.0.0.0 40.0.0.2
R2(config)#ip route 20.0.0.0 255.0.0.0 40.0.0.2

We can also use static routing with exit interface format like the following

R2(config)#ip route 10.0.0.0 255.0.0.0 serial 0/0
R2(config)#ip route 20.0.0.0 255.0.0.0 serial 0/0

Static Routing using Exit interface in Router 2

Here Serial 0/0 is the exit interface of Router 2

Routing table if Exit interface syntax used
Static Routing Table of Router 2 with exit interface

How to Remove Static Routing From a Cisco Router

In many situations we may have to remove static routing capability in some routers. In order to remove Static Routing from a Cisco router we have to use the following command.

Router(config)#no ip route [Destination Network ID] [Subnet mask]

For our example,

Removing Static Route from Router 1

R1(config)#no ip route 30.0.0.0 255.0.0.0

Removing Static Route from Router 2

R2(config)#no ip route 10.0.0.0 255.0.0.0
R2(config)#no ip route 20.0.0.0 255.0.0.0

Hope Cisco static routing explained here in detail. If you have any doubts of need any clarification feel free to comment here. I will be coming with RIP Dynamic Routing on next article.
Meanwhile practice this Cisco static routing tutorial.

Cheers…!

2 thoughts on “How to Configure Static Routing on a Cisco router

  1. Sunil Kumar Singh

    I have basic idea of CCNA.
    Since I wanna to be certified this year,So looking for more tutorials and questions on routing(static,default,rip,eigrp etc) for practice.

    Reply
  2. Sunil Kumar Singh

    First of all,
    Thanking you very much for teaching and guiding us so nicely.

    I have basic knowledge of CCNA.
    I wanna to be CCNA Certified this year,So looking for more tutorials and routing based questions(static,default,rip etc.). I am poor in this section.

    I have you will provide me above soon.

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *