0% found this document useful (0 votes)
119 views

How To Configure Static Routing in Cisco Router: Experiment No.4

The document discusses how to configure static routing in Cisco routers. It provides examples of configuring static routes between Router 1 and Router 2 to reach different networks. There are two methods shown - using the next hop IP address or using the exit interface. The configuration process includes assigning IP addresses to router interfaces and adding static routes. The routing tables are displayed before and after to confirm the static routes were added correctly. It also explains how to remove static routes from the router configuration.

Uploaded by

Sujit Khandare
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
119 views

How To Configure Static Routing in Cisco Router: Experiment No.4

The document discusses how to configure static routing in Cisco routers. It provides examples of configuring static routes between Router 1 and Router 2 to reach different networks. There are two methods shown - using the next hop IP address or using the exit interface. The configuration process includes assigning IP addresses to router interfaces and adding static routes. The routing tables are displayed before and after to confirm the static routes were added correctly. It also explains how to remove static routes from the router configuration.

Uploaded by

Sujit Khandare
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

Experiment No.

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)


Without any configuration Network 1 and Network 2 can communicate each other. Below figure
shows 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

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

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


Cisco static route via interface gives updated static routing table like the following
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)

Below figure shows routing table of Router 1.


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 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
Here Serial 0/0 is the exit interface of Router 2
Routing table if Exit interface syntax used

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.

You might also like