IP Static Routes

A static route is a special route that is manually configured by a network administrator. The disadvantage of static routes is that they cannot adapt to the change in a network automatically, so network changes require manual reconfiguration. Static routes are fit for networks with comparatively simple structures. It is not advisable to configure and maintain static routes for a network with a complex structure. Static routes do however reduce the effect of bandwidthand CPU resource consumption that occurs when other protocols are implemented.

Static routes can be applied to networks that use both serial and Ethernet based media, however in each situation the conditions of applying the static route vary in which either the outbound interface or the next-hop IP address must be defined. 

The serial medium represents a form of point-to-point (P2P) interface for which the outbound interface must be configured. For a P2P interface, the next-hop address is specified after the outbound interface is specified. That is, the address of the remote interface (interface on the peer device) connected to this interface is the next-hop address.

For example, the protocol used to encapsulate over the serial medium is the Pointto-Point protocol (PPP). The remote IP address is obtained following PPP negotiation, therefore it is necessary to specify only the outbound interface. The example also defines a form of point-to-point Ethernet connection, however Ethernet represents a broadcast technology in nature and therefore the principles of point-to-point technology do not apply 

 
In the case of broadcast interfaces such as Ethernet, the next-hop must be defined. Where the Ethernet interface is specified as the outbound interface, multiple next hops are likely to exist and the system will not be able to decide which next-hop is to be used. In determining the next-hop, a router is able to identify the local connection over which the packet should be received.

In the example, packets intended for the destination of 192.168.2.0/24 should be forwarded to the next-hop of 10.0.123.2 to ensure delivery. Alternatively reaching the destination of 192.168.3.0 requires that the next-hop of 10.0.123.3 be defined. 

The configuration of the static route is achieved using the ip route-static ipaddress { mask | mask-length } interface-type interface-number [ nexthop-address where the ip-address refers to the network or host destination address. The mask field can be defined as either a mask value or based on the prefix number. In the case of a broadcast medium such as Ethernet, the next-hop address is used. Where a serial medium is used, the interface-type and interface-number are assigned (e.g. serial 1/0/0) to the command to define the outgoing interface.  

Where equal cost paths exist between the source and destination networks, load balancing can be implemented to allow traffic to be carried over both links. In order to achieve this using static routes, both routes must meet the parameters for an equal longest match, preference and metric value. The configuration of multiple static routes, one for each next-hop or outbound interface in the case of serial medium is required. 

The example demonstrates how two ip route-static commands are implemented, each defining the same IP destination address and mask, but alternate next-hop locations. This ensures that the longest match (/24) is equal, and naturally so is the preference value, since both routes are static routes that carry a default preference of 60. The cost of both paths is also equal allowing load balancing to occur. 

The routing table can be queried to verify the results by running the display ip routing-table command after the static routes are configured. The static route is displayed in the routing table, and results show two entries to the same destination, with matching preference and metric values. The different next-hop addresses and variation in the outbound interface identifies the two paths that are taken, and confirms that load balancing has been achieved. 

The application of static routes allows for a number of ways that routes can be manipulated to achieve routing requirements. It is possible for the preference of a static route to be changed for the purpose of enabling the preference of one static route over another, or where used with other protocols, to ensure the static route is either preferred or preference is given to the alternative routing protocol.

The default preference value of a static route is 60, therefore by adjusting this preference value, a given static route can be treated with unequal preference over any other route, including other static routes. In the example given, two static routes exist over two physical LAN segments, while normally both static routes would be considered equal, the second route has been given a lesser preference (higher value) causing it to be removed from the routing table. The principle of a floating static route means that the route with a lesser preference will be applied to the routing table, should the primary route ever fail. 

In using the display ip routing-table command, it is possible for the results of the change to the preference value that results in the floating static route, to be observed. Normally two equal cost routes would be displayed in the routing table defining the same destination, however having alternative next-hop values and outbound interfaces. In this case however, only one instance can be seen, containing the default static route preference value of 60. Since the second static route now has a preference value of 100, it is not immediately included in the routing table since it is no longer considered an optimal route. 

In the event that the primary static route should fail as a result of physical link failure or through the disabling of an interface, the static route will no longer be able to provide a route to the intended destination and therefore will be removed from the routing table. The floating static route is likely to become the next best option for reaching the intended destination, and will be added to the routing table to allow packets to be transmitted over a second alternative path to the intended destination, allowing continuity in light of any failure.

When the physical connection for the original route is restored, the original static route also will take over from the current floating static route, for which the route will be restored in the routing table causing the floating static route to once again await application.

The default static route is a special form of static route that is applied to networks in which the destination address is unknown, in order to allow a forwarding path to be made available. This provides an effective means of routing traffic for an unknown destination to a router or gateway that may have knowledge of the forwarding path within an enterprise network.

The default route relies on the “any network” address of 0.0.0.0 to match any network to which a match could not be found in the routing table, and provides a default forwarding path to which packets for all unknown network destinations should be routed. In the example, a default static route has been implemented on RTA, identifying that should packets for a network that is unknown be received, such packets should be forwarded to the destination 10.0.12.2.

In terms of routing table decision making, as a static route, the default route maintains a preference of 60 by default, however operates as a last resort in terms of the longest match rule in the route matching process.

The configuration of the static route once configured will appear within the routing table of the router. The display ip routing-table command is used to view this detail. As a result, all routes in the example where not associated with any other routes in the routing table will be forwarded to the next-hop destination of 10.0.12.2 via the interface Gigabit Ethernet 0/0/0.

SUMMARY

A floating static route can be implemented by adjusting the preference value of a static route where two static routes support load balancing.

A default static route can be implemented in the routing table by specifying the ‘any network’ address of 0.0.0.0 as the destination address along with a nexthop address of the interface to which packets captured by this default static route are to be forwarded.