Content

| 3.1 |  | Routing |
| 3.1.2 |  | Static routing |

Static routing is useful in networks that do not have multiple paths to any destination network. Static routing reduces the memory and processing burdens on a router. Even on large internetworks, administrators often configure static routes on access routers that connect stub networks. Stub networks have only one way in and one way out. In Figure , RTZ is configured with a static route to 172.24.4.0 /24.

To configure static routing on a Cisco router, use the ip route command. This command uses the following syntax:

> Router(config)#ip route destination-prefix destination-prefix-mask {address | interface} [distance] [tag tag] [permanent]

Figure describes the parameters that are used with this command.

An entry can be manually added to a routing table by using one of the following two versions of the

ip route command:

> RTA(config)#ip route 10.6.0.0 255.255.0.0 s1

or
RTA(config)#ip route 10.7.0.0 255.255.0.0 10.4.0.2

Both of these global configuration commands will add a static route to the routing table. The first example maps a network prefix, 10.6.0.0/16, to a local physical interface, S1, on the router. A directly connected network is also mapped to an interface. The second example maps the network prefix, 10.7.0.0/16, to the next hop address, 10.4.0.2. Each of these commands will add valid static routes to the routing table.

In Figure , the route to 10.6.0.0 is identified as a static route by the S at the beginning of the line. However, it is formatted similarly to a directly connected route. This is because the router has been configured to forward packets for 10.6.0.0 out S1. The entry in the routing table for the static route to 10.7.0.0 is configured with a next hop address. This entry in the routing table is similar to dynamic routes. The next hop address is included in the routing table because the packets destined for 10.7.0.0 should be forwarded to an interface at 10.4.0.2 on another router. What is the difference between these two kinds of static routes?

When using a routing protocol such as RIP or IGRP, static routes that are shown as directly connected will be automatically advertised to other routers if the appropriate

network command has been issued. The next hop static route will not be advertised without additional configuration. These static routes can be included in updates if they are injected, or redistributed into the dynamic routing protocol.

When an interface goes down, all static routes mapped to that interface are removed from the IP routing table. If the router can no longer find a valid next hop for the address specified in a static route, the static route is removed from the table. An alternative method is to map a static IP address to a loopback interface.

> Note: As a rule, the next hop address should always be used when defining a static route on a multi-access network such as Ethernet. A router interface on a multi-access network could have several link partners, so the next hop address must be used to specify which neighbor should receive traffic for a given network.

Static routing is not suitable for large, complex networks that include redundant links, multiple protocols, and meshed topologies. Routers in complex networks must adapt to topology changes quickly and select the best route from multiple candidates. Therefore, dynamic routing is the better choice.

| Lab Activity e-Lab Activity: Static Routing This lab is to create a static route on the router.