Types of Static Routes Explained

This tutorial explains static network routes, static host routes, fix static routes, and floating static routes. Learn the types of a static route in detail.

A router automatically learns the available networks on its interfaces but it cannot learn the networks available on other router's interfaces. If a network is available on another router’s interface, either you have to manually add a route for the network or have to configure a routing protocol that learns and adds the route for the network. If you manually add a route to the routing table, the route is known as a static route. Routers use the code S to identify a static route in the routing table.

To create and add a static route to the routing table, we use the 'ip route' command. The 'ip route' command needs the following information.

  1. The destination network or host
  2. How to reach the destination network or host
  3. Additional control options

There are four types of a static route. These types are the static network route, static host route, fix static route, and the floating static route. Each type uses the above information in a different way. Let’s discuss the above information and how each type uses the above information.

The destination network or host

This is the destination network or host for which you create the static route. If you create a static route for a network, the route is known as a static network route. And if you create a static route for a host, the route is known as a static host route.

To create a static network route, you have to use the subnet mask of the network. To create a host static host route, you have to use the subnet mask 255.255.255.255.

For example, if you want to create a static route for the network 30.0.0.0/8, then the destination network will be 30.0.0.0 255.0.0.0. Or if you want to create a static route for the host 30.0.0.100/8, then the destination host will be 30.0.0.100 255.255.255.255.

How to reach the destination network or host

This is the method to forward data packets to the destination network or host specified in the previous parameter. You have two methods to forward data packets. You can specify a local interface or the IP address of the next-hop router. If you specify a local interface, the router forwards the destination network’s data packets from the local interface. If you specify the IP address of the next-hop router, the router forwards the destination network’s data packets to the next-hop router.

Let’s take an example.

The following image shows an example network.

packet tracer lab

In this network, you can use either the value GigbitEthernet0/1 (local interface) or the IP address 20.0.0.2 (next-hop router) on Router0 to forward data packets to the network 30.0.0.0/8 via Router1.

The following image shows the first option.

next hop router

The following image shows the second option.

local interface to forward packets

Additional control options

The 'ip route' command supports two additional parameters. These parameters are administrative distance and permanent. Routers use the AD (Administrative Distance) value to select the best route from multiple routes to the same destination. Routers select the route that has the lowest administrative distance value.

If you have two routes to the same destination, you can use one route as the main route and another route as the backup route. To configure another route as the backup route, use the administrative distance value of another route higher than the main route.

If multiple routes for the same route exist, the router always uses the route that has the lowest administrative distance value. Since you have configured the administrative distance value of the backup route higher than the main route, the router will not use the backup route as long as the main route is up.

If the main route goes down, the backup route automatically becomes the winner as no route left for the competition.

If the main route turns up again, due to its lower administrative distance value, it becomes the winner again. The router removes the backup route from the routing table and adds the main route again to the routing table.

Since the router adds the backup route to the routing table only when the main route fails and removes the backup route from the routing table as soon as the main route turns up, the backup route is known as the floating static route. A floating static route is a route that the router adds or removes from the routing table as per the link status of the route.

Let’s take the above example network again. In this network, Router0 has two routes for network 30.0.0.0/8. The first route connects Router0 to network 30.0.0.0/8 via Router1. The second route connects Router0 to network 30.0.0.0/8 via Router2 and Router1.

different routes to destination

To configure the first route as the main route, you can set its AD value to smaller than the value of the second route. For example, you can set the AD value of the first route to 10 and the AD value of the second route to 20.

By default, the router automatically removes a route from the routing table if the route’s link is down. The permanent parameter overrides this behaviour. If you use this parameter, the router always keeps the route in the routing table no matter whether the route’s link is up or down. This route is known as the fix static route. A fix static route is the route that the router always keeps in the routing table.

This tutorial is the second part of the tutorial "Static Routing Configuration, Commands, and Concepts Explained". The other parts of this tutorial are the following.

Static Routes and Static Routing Explained
IP Route command Explained with Examples
Static Routing Configuration Guide with Examples

That's all for this part of the tutorial. In this part, we discussed types of static routes. In the next part of the tutorial, we will learn how to use the 'ip route' command to configure static routes on routers.

ComputerNetworkingNotes CCNA Study Guide Types of Static Routes Explained