In this post, we will discuss the basics of routing, the difference between dynamic and static routing, and how to perform static routing configuration.
Routing is a process that builds the routing table on a router. A packet transmitting within the same subnet does not require any routing information to reach its destination. However, if a packet is transmitting from one subnet to another subnet, it requires routing information, such as destination network, subnet mask, and default gateway, to reach its destination.
Dynamic vs Static Routing
There are two methods that can be used to add routing information to a router.
As the name suggest, static routing is configured by an administrator manually. Static routing does not use any routing algorithm or mechanism to update the routing tables. This method is more suitable for a small network, where one can easily memorize all the routes information. Since static routing does allow automatic route updates, hence, it is considered more secure than the dynamic routing.
Suppose a network topology that contains 30 routers and each router have multiple subnets. How one can memorize which network is connected to which router and what gateway is required for which network. This is a really very tough task. Here, comes dynamic routing comes as a solution for this. Dynamic routing is typically configured with the help of protocols called routing protocols. Since dynamic routing updates routing information between routers automatically, hence, it is more suitable for a large network. In addition, it is less time-consuming than the static routing. However, dynamic routing consumes more resources, such as CPU, memory, and bandwidth than the static routing.
Static Routing Configuration: Step by Step
Before you can configure static routing, you should know the syntax of theIP route command that is used to configure static routing. The syntax of the ip route command as follows:
Router(config)#ip route <destination network> <subnet mask> <exit interface or default gateway>
Once you have learned and understood what is static routing? let’s see how to configure static routing. To configure static routing, we will use the following topology. If you are using a simulator, such as Cisco Packet Tracer, create the following topology in Cisco Packet Tracer and configure the IP addresses on routers and PCs as mentioned in the topology.
In the preceding topology, on Router0, we need to add the network(s) that are not connected directly (188.8.131.52/8). To do this, execute the following command on Router0.
Router0(config)#ip route 184.108.40.206 255.0.0.0 192.168.1.2
Similarly, on Router1 add the 10.0.0./8 network using the ip route command.
Router1(config)#ip route 10.0.0.1 255.0.0.0 192.168.1.1
Once you have executed the preceding commands on both the routers, verify the routing table by executing the show ip route command.
In the preceding figure, you can see that the 220.127.116.11/8 network is added on Router0 through the static routing. Now, you can use the ping command to check the connectivity between devices in the network topology.
In this post, we have discussed what is static routing and how to configure it (static routing configuration). Now, move to the next posts and learn how to configure dynamic routing using the routing protocols.
- Also read: Configure RIP routing – step by step guide.