What are static routes and why to use them?
Static routing is a form of routing that occurs when a router uses a manually-configured routing entry, rather than information from a dynamic routing traffic. In many cases, static routes are manually configured by a network administrator by adding in entries into a routing table, though this may not always be the case. Unlike dynamic routing, static routes are fixed and do not change. Static routing can also be used to provide a gateway of last resort or provide backups in the event that dynamic routing information fails to be exchanged.
In the network below there are a total of three routers and two end-user computers. In real world deployments a network could have dozens or hundreds of routers or devices depending on the scale of the network. Regardless of the network complexity routing serves the same role in that its purpose direct traffic so devices know how to transverse networks and remote devices can return traffic back to the requester. However, with even a small number of routers or unique networks static routing can be very cumbersome. Hence, the creation of dynamic routing.
Steps to configure static routes
Step 1: Configure all applicable router interfaces.
R1(config)#interface FastEthernet0/0 R1(config-if)#ip address 10.2.0.2 255.255.255.0 ! R1(config)#interface FastEthernet0/1 R1(config-if)#ip address 10.1.0.1 255.255.255.0
Step 2: Configure static routes to all remote networks unknown to the router. This must include a route to the network the remote computer resides as well as any remote networks between the source router and destination not directly connected to the source router.
R1(config)#ip route 10.3.0.0 255.255.255.0 10.2.0.1 R1(config)#ip route 10.4.0.0 255.255.255.0 10.2.0.1
Step 3: Repeat the same steps on all remaining routers with the applicable interface and routing configurations.
Verify the configuration
Now that the configuration is finished lets verify our routes. Using the show ip route command you can verify the expected routes in the routing table. Use the ping command to verify connectivity.