How to configure static routing on routers?

How to configure static routing on routers? In this article, we learn how to configure static routing on a router. Static routing is very secure routing from all other routings like rip routing, OSPF routing, EIGRP routing, and dynamic routing. The main benefit of this routing is as follows it is more secure than others. static routing is easy to configure in a small network. Now I will show you how to configure static routing on a router by a lab example. In the previous article, we talked about how to configure a Cisco router to connect to different networks?

When we connect different networks we have to use routers in between the networks. and if we have to make the networks work/connect which are not connected directly to the router we have to configure routing on the routers. routing is of two types:-

  1. Static routing: In stating routing we have to give information and path of each network manually.
  2. Dynamic routing: Dynamic routing is the routing in which we only have to give the information about the network which is directly connected and the router itself gets further information.
how to configure static routing

First of all, go to router R1 and assign IP address on both the routers

Router R1

--- System Configuration Dialog ---
Continue with configuration dialog? [yes/no]: no
Press RETURN to get started!
Router>enable
Router#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#hostname R1
R1(config)#
R1(config)#interface FastEthernet0/0
R1(config-if)#ip address 1.0.0.1 255.0.0.0
R1(config-if)#no shutdown
R1(config-if)#
%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
R1(config-if)#exit
R1(config)#interface FastEthernet0/1
R1(config-if)#ip address 2.0.0.1 255.0.0.0
R1(config-if)#no shutdown
R1(config-if)#
%LINK-5-CHANGED: Interface FastEthernet0/1, changed state to up
R1(config-if)#exit
R1(config)#

Router R2

--- System Configuration Dialog ---
Continue with configuration dialog? [yes/no]: no
Press RETURN to get started!
Router>enable
Router#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#hostname R2
R2(config)#
R2(config)#interface FastEthernet0/0
R2(config-if)#ip address 2.0.0.2 255.0.0.0
R2(config-if)#no shutdown
R2(config-if)#
%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
R2(config-if)#exit
R2(config)#interface FastEthernet0/1
R2(config-if)#ip address 3.0.0.1 255.0.0.0
R2(config-if)#no shutdown
R2(config-if)#
%LINK-5-CHANGED: Interface FastEthernet0/1, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up
R2(config-if)#exit
R2(config)#

Now all the ports will be up of both the routers and IP address also is assigned to all interfaces of routers.

Talking about switches: How we can do basic configurations on the Cisco switches? such as set a hostname, set a banner on the switch, etc. then click here and give it a try.

Now assign IP address to the computers according to their respective networks.

Now we have to configure static routing on both of the routers so they can communicate with each other and send data in between the networks. To configure static routing go to configure mode in router and type command

On router R1 type

R1(config)#ip route 3.0.0.0 255.0.0.0 2.0.0.2

On router R2 type

R2(config)#ip route 1.0.0.0 255.0.0.0 2.0.0.1

Here in these commands, ip route is the command that indicates the routing path for the routers. first 3.0.0.0 and 1.0.0.0 are the network address of the network which are not directly connected to routers and 255.0.0.0 is the subnet mask of the network. Here 2.0.0.2 and 2.0.0.1 is the gateway IP, of the port of other routers from which the network is going out to connect to another network.

After configuring routing on both the routers you can check the networks are communicating with each other or not by ping command in command prompt like I did here.

Here I am taking pc0 on witch IP address 1.0.0.2 is assigned and ping it with IP address 3.0.0.2 basically we want to communicate network 1.0.0.0 with network 3.0.0.0 through the network 2.0.0.0 in which both the routers are present. Refer to the figure shown above.

PC>ping 3.0.0.2
Pinging 3.0.0.2 with 32 bytes of data:
Reply from 3.0.0.2: bytes=32 time=1ms TTL=126
Reply from 3.0.0.2: bytes=32 time=1ms TTL=126
Reply from 3.0.0.2: bytes=32 time=1ms TTL=126
Reply from 3.0.0.2: bytes=32 time=1ms TTL=126
Ping statistics for 3.0.0.2:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 1ms, Maximum = 1ms, Average = 1ms

If you have this type of result your static routing will be configured perfectly on each router and All the PCs will communicate with each other perfectly which are present in the different networks.

THAT’S IT

Comment your thoughts.

You may also like...

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: