Static Routing Configuration Guide with
Examples
This tutorial explains how to configure static routing on routers. Learn how to create and manage static
routes on routers through a packet tracer example.
Static routes are the routes you manually add to the router’s routing table. The process of adding static
routes to the routing table is known as static routing. Let’s take a packet tracer example to understand
how to use static routing to create and add a static route to the routing table.
Setting up a practice lab
Create a packet tracer lab as shown in the following image or download the following pre-created lab and
load it on Packet Tracer.
In this lab, each network has two routes to reach. We will configure one route as the main route and
another route as the backup route. If the link bandwidth of all routes is the same, we use the route that has
the least number of routers as the main route. If the link bandwidth and the number of routers are the
same, we can use any route as the main route and another route as the backup route.
If we specify two routes for the same destination, the router automatically selects the best route for the
destination and adds the route to the routing table. If you manually want to select a route that the router
should add to the routing table, you have to set the AD value of the route lower than other routes. For
example, if you use the following commands to create two static routes for network 30.0.0/8, the route
will place the first route to the routing table.
#ip route [Link] [Link] [Link] 10
#ip route [Link] [Link] [Link] 20
If the first route fails, the router automatically adds the second route to the routing table.
Page. 1/7
Creating, adding, verifying static routes
Routers automatically learn their connected networks. We only need to add routes for the networks that
are not available on the router’s interfaces. For example, network [Link]/8, [Link]/8 and [Link]/8 are
directly connected to Router0. Thus, we don’t need to configure routes for these networks. Network
[Link]/8 and network [Link]/8 are not available on Router0. We have to create and add routes only for
these networks.
The following table lists the connected networks of each router.
Router Available networks on local interfaces Networks available on other routers’ interfaces
Router0 [Link]/8, [Link]/8, [Link]/8 [Link]/8, [Link]/8
Router1 [Link]/8, [Link]/8, [Link]/8 [Link]/8, [Link]/8
Router2 [Link]/8, [Link]/8 [Link]/8, [Link]/8, [Link]/8
Let's create static routes on each router for networks that are not available on the router.
Router0 requirements
• Create two routes for network [Link]/8 and configure the first route (via -Router1) as the main
route and the second route (via-Router2) as a backup route.
• Create two routes for the host [Link]/8 and configure the first route (via -Router2) as the main
route and the second route (via-Router1) as a backup route.
• Create two routes for network [Link]/8 and configure the first route (via -Router2) as the main
route and the second route (via-Router1) as a backup route.
• Verify the router adds only main routes to the routing table.
Router0 configuration
Access the CLI prompt of Router0 and run the following commands.
Page. 2/7
Router1 requirements
• Create two routes for network [Link]/8 and configure the first route (via -Router0) as the main
route and the second route (via-Router1) as a backup route.
• Create two routes for network [Link]/8 and configure the first route (via -Router0) as the main
route and the second route (via-Router2) as a backup route.
• Verify the router adds only main routes to the routing table.
Router1 configuration
Router2 requirements
Create static routes for network [Link]/8 and network [Link]/8 and verify the router adds both routes
to the routing table.
Router2 configuration
Page. 3/7
Verifying static routing
On Router0, we configured two routes for network [Link]/8. These routes are via Router1 and via
Router2. We set the first route (via-Router1) as the main route and the second route as the backup route.
We can verify this configuration in two ways.
By sending ping requests to a PC of network [Link]/8 and tracing the path they take to reach the
network [Link]/8. For this, you can use 'tracert' command on a PC of network [Link]/8. The 'tracert'
command sends ping requests to the destination host and tracks the path they take to reach the
destination.
By listing the routing table entries on Router0. Since a router uses the routing table to forward data
packets, you can check the routing table to figure out the route the router uses to forward data packets for
each destination.
The following image shows the above testing.
Page. 4/7
We also configured a separate static host route for the host [Link]/8. The router must use this route to
forward data packets to the host [Link]/8. To verify this, you can do the same testing for the host
[Link]/8.
The following image shows this testing.
Page. 5/7
We also configured a backup route for network [Link]/8. The router must put the backup route to the
routing table and use it to forward data packets to network [Link]/8 when the main route fails. To verify
this, we have to simulate the failure of the main route.
To simulate the failure of the main route, you can delete the link between Router0 and Router1. After
deleting the link, do the same testing again for the network [Link]/8.
Page. 6/7
Deleting a static route
To delete a static route, use the following steps.
• Use the 'show ip route static' command to print all static routes.
• Note down the route you want to delete.
• Use the 'no ip route' command to delete the route.
If you have a backup route, the backup route becomes the main route when you delete the main route.
In our example, we have a backup route and a main route for the host [Link]/8. The following image
shows how to delete both routes.
That’s all for this tutorial. In this tutorial, we discussed static
routing and learned how to create, add, and manage static
routes on the router.
Page. 7/7