Static Routing Configuration Guide with Examples
Static routes are manually added routes in the routing table. Adding static routes to the routing table is called static routing. Static routing lets you control how data flows through your network. This tutorial explains how to create, configure, verify, and manage static routes.
Lab setup
This lab is optional. You need it only if you want to follow this exercise. If you need only commands and configuration steps, you can skip it. You can use real devices or a network simulation software to set up this lab. This tutorial uses Packet Tracer network simulation software. It also provides download links with all the configuration steps of this lab.
Create a Packet Tracer lab shown in the following image, or download the pre-built lab from the following link.
Packet Tracer lab with initial IP configurations

In this lab, each network can be reached via two routes. Configure one route as the primary route and another as the backup. If all routes have equal link bandwidth, select the route with the fewest routers as the primary route. If both link bandwidth and the number of routers are identical, either route may serve as the primary, with the other as the backup.
When two routes to the same destination are specified, the router automatically selects the optimal route and adds it to the routing table. To manually prioritize a specific route, set its administrative distance (AD) value lower than that of alternative routes. For example, the following commands create two static routes for network 30.0.0/8, with the first route placed in the routing table.
#ip route 30.0.0.0 255.0.0.0 20.0.0.2 10 #ip route 30.0.0.0 255.0.0.0 40.0.0.2 20
If the first route fails, the router automatically adds the second route to the routing table.
Creating, adding, and verifying static routes
Routers automatically recognize networks connected to their interfaces. Therefore, it is necessary to add static routes only for networks that are not directly accessible from the router’s interfaces. For instance, networks 10.0.0.0/8, 20.0.0.0/8, and 40.0.0.0/8 are directly connected to Router0, so no additional configuration is required for these. However, networks 30.0.0.0/8 and 50.0.0.0/8 are not directly accessible from Router0, so static routes must be created and added.
The following table lists the connected networks of each router.
| Router | Available networks on local interfaces | Networks available on other routers’ interfaces |
| Router0 | 10.0.0.0/8, 20.0.0.0/8, 40.0.0.0/8 | 30.0.0.0/8, 50.0.0.0/8 |
| Router1 | 20.0.0.0/8, 30.0.0.0/8, 50.0.0.0/8 | 10.0.0.0/8, 40.0.0.0/8 |
| Router2 | 40.0.0.0/8, 50.0.0.0/8 | 10.0.0.0/8, 20.0.0.0/8, 30.0.0.0/8 |
Create static routes on each router for networks that are not directly accessible from that router.
Router0 requirements
- Create two routes for network 30.0.0.0/8, and configure the first route (via Router1) as the primary route and the second (via Router2) as a backup.
- Create two routes for the host 30.0.0.100/8, and configure the first route (via Router2) as the primary and the second (via Router1) as the backup.
- Create two routes for network 50.0.0.0/8, and configure the first route (via Router2) as the primary and the second (via Router1) as the backup.
- Verify the router adds only primary routes to the routing table.
Router0 configuration
Router>enable Router#configure terminal Enter configuration commands, one per line. End with CNTL/Z. Router(config)#ip route 30.0.0.0 255.0.0.0 20.0.0.2 10 Router(config)#ip route 30.0.0.0 255.0.0.0 40.0.0.2 20 Router(config)#ip route 30.0.0.100 255.255.255.255 40.0.0.2 10 Router(config)#ip route 30.0.0.100 255.255.255.255 20.0.0.2 20 Router(config)#ip route 50.0.0.0 255.0.0.0 40.0.0.2 10 Router(config)#ip route 50.0.0.0 255.0.0.0 20.0.0.2 20 Router(config)#exit Router#show ip route static 30.0.0.0/8 is variably subnetted, 2 subnets, 2 masks S 30.0.0.0/8 [10/0] via 20.0.0.2 S 30.0.0.100/32 [10/0] via 40.0.0.2 S 50.0.0.0/8 [10/0] via 40.0.0.2 Router#

Router1 requirements
- Create two routes for network 10.0.0.0/8, and configure the first route (via Router0) as the primary route and the second (via Router1) as a backup.
- Create two routes for network 40.0.0.0/8, and configure the first route (via Router0) as the primary route and the second (via Router2) as the backup.
- Verify the router adds only primary routes to the routing table.
Router1 configuration
Router>enable Router#configure terminal Enter configuration commands, one per line. End with CNTL/Z. Router(config)#ip route 10.0.0.0 255.0.0.0 20.0.0.1 10 Router(config)#ip route 10.0.0.0 255.0.0.0 50.0.0.1 20 Router(config)#ip route 40.0.0.0 255.0.0.0 20.0.0.1 10 Router(config)#ip route 40.0.0.0 255.0.0.0 50.0.0.1 20 Router(config)#exit Router#show ip route static S 10.0.0.0/8 [10/0] via 20.0.0.1 S 40.0.0.0/8 [10/0] via 20.0.0.1 Router#

Router2 requirements
Create static routes for networks 10.0.0.0/8 and 30.0.0.0/8, and verify that the router adds both routes to the routing table.
Router2 configuration
Router>enable Router#configure terminal Enter configuration commands, one per line. End with CNTL/Z. Router(config)#ip route 10.0.0.0 255.0.0.0 40.0.0.1 Router(config)#ip route 30.0.0.0 255.0.0.0 50.0.0.2 Router(config)#exit Router#show ip route static S 10.0.0.0/8 [1/0] via 40.0.0.1 S 30.0.0.0/8 [1/0] via 50.0.0.2 Router#

Verifying static routing
On Router0, you configured two routes for network 30.0.0.0/8: one via Router1 and another via Router2. The first route (via Router1) serves as the primary, while the second serves as the backup. You can verify this configuration using two methods.
Send ping requests to a PC on network 30.0.0.0/8 and trace the path taken to reach that network. The 'tracert' command, executed on a PC in network 10.0.0.0/8, sends ping requests to the destination host and records the route taken to reach it.
List the routing table entries on Router0. Since the router uses the routing table to forward data packets, examining these entries reveals the route selected for each destination.

You also configured a separate static route for the 30.0.0.100/8 subnet. The router will use this route to forward data packets to the host 30.0.0.100/8. To verify this, perform the same tests on the host 30.0.0.100/8.

You also configured a local interface as the backup route to forward data packets for network 30.0.0.0/8. The router will add the backup route to the routing table and use it to forward data packets to network 30.0.0.0/8 if the primary route fails. To verify this behavior, simulate the failure of the main route.
To simulate the failure of the main route, delete the link between Router0 and Router1. After removing the link, repeat the testing for network 30.0.0.0/8.

The following link provides this lab with the above configuration.
Packet Tracer Lab with Static Route Configuration
Deleting a static route
To delete a static route, follow these 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 a backup route is configured, it becomes the primary route when the main route is deleted. In this example, both a backup route and a main route are configured for the host 30.0.0.100/8. The following image demonstrates the process of deleting both routes.

This tutorial is part of the tutorial series "Static Routing Configuration, Commands, and Concepts Explained". Other parts of this series are the following.
Chapter 1 Static Routes and Static Routing Explained
Chapter 2 Types of Static Routes Explained
Chapter 3 IP Route Command Explained with Examples
Chapter 4 Static Routing Configuration Guide with Examples
Conclusion
Static routing allows you to control routing paths in the routing table. While this method is straightforward and reliable for small or stable networks, it requires careful planning and management, particularly when incorporating backup routes or responding to network changes. Through configuration examples and systematic verification methods, this guide demonstrates the implementation, validation, and troubleshooting of static routes. Understanding the fundamentals of static routing is essential for advanced routing techniques and maintaining robust, predictable network connectivity.
By ComputerNetworkingNotes Updated on 2026-01-05