
Static Routing
overview of fundamental static route concepts.
- Using static routing requires zero network bandwidth because implementing manual route entries does not require communication with other routers.
- Because the routers are not communicating, there is no network intelligence. If a link goes down, other routers will not be aware that the network path is no longer valid.
Static Routing and Static Route Types
Static routes are useful when:
- Dynamic routing protocols cannot be used on a router because of limited router CPU or memory.
- Routes learned from dynamic routing protocols need to be superseded.
- Directly attached static routes
- Recursive static route
- Fully specified static route
Directly Attached Static Routes
A static route that uses only the outbound next-hop interface is known as a directly attached static route. The outbound interface specified must be in an up state for the route to be installed into the RIB. Note: Configuring a directly attached static route to an interface that uses ARP, such as an Ethernet network, causes problems and is not recommended. The router must repeat the ARP process for every destination that matches the static route, which consumes CPU and memory. In larger networks, this can cause router instability issues. Point-to-point (P2P) serial interfaces do not use ARP, so static routes can directly reference the outbound interface of a router. Directly attached static routes are configured with the command ip route network subnetmask next-hop-interface-id..
Directly Attached Static Route
R1 indicates that the 10.22.22.0/24 network is reachable via the S1/0 interface, and R2 indicates that the 10.11.11.0/24 network is reachable via the S1/0 interface. A directly attached static route does not display [AD/Metric] information when looking at the routing table.
Recursive Static Routes
The forwarding engine on Cisco devices needs to know which interface an outbound packet should use.
- A recursive static route specifies the IP address of the next-hop address.
- The recursive lookup occurs when the router queries the RIB to locate the route toward the next-hop IP address (connected, static, or dynamic) and then cross-references the adjacency table.
- Recursive static routes are configured with the command ip route network subnet-mask next-hop-ip.
- Recursive static routes require the route’s next-hop address to exist in the routing table to install the static route into the RIB. A recursive static route may not resolve the next-hop forwarding address using the default route (0.0.0.0/0) entry. The static route will fail next-hop reachability requirements and will not be inserted into the RIB.
R1 uses a recursive static route to the 10.22.22.0/24 network, and R2 uses a recursive static route to the 10.11.11.0/24 network to allow connectivity between these networks. In Example 6-6, R1’s configuration states that the 10.22.22.0/24 network is reachable via the 10.12.1.2 IP address, and R2’s configuration states that the 10.11.11.0/24 network is reachable via the 10.12.1.1 IP address.
Fully Specified Static Routes
Static route recursion can simplify topologies if a link fails because it may allow the static route to stay installed while it changes to a different outbound interface in the same direction as the destination. However, problems arise if the recursive lookup resolves to a different interface pointed in the opposite direction. The following will correct the issue:
- The static route configuration should use the outbound interface and the next-hop IP address ( a fully specified static route).
- Specifying the next-hop address along with the physical interface removes the recursive lookup and does not involve the ARP processing problems that occur when using only the outbound interface.
- Fully specified static routes are configured with ip route network subnet-mask interface-id next-hop-ip.
Floating Static Routing
Using a floating static route is a common technique for providing backup connectivity for prefixes learned via dynamic routing protocols. A floating static route is configured with an AD higher than that of the primary route (default AD on a static route is 1). Because the AD is higher than that of the primary route, it is installed in the RIB only when the primary route is withdrawn. In Figure 6-11, R1 and R2 are configured with two links. The 10.12.1.0/24 transit network is preferred to the 10.12.2.0/24 network. The static route using the Ethernet link (10. 12.1.0/24) has an AD of 10, and the serial link (10.12.2.0/24) has an AD set to 210.
Static Null Routes
Configuring a static route to a null interface provides a method of dropping network traffic without requiring the configuration of an access list. Creating a static route to the Null0 interface is a common technique to prevent routing loops. Figure 6-12 shows a common topology in which company ABC has acquired the 172.16.0.0/20 network range from its service provider. ABC uses only a portion of the given addresses but keeps the large network block in anticipation of future growth.
Example 6-14 shows the routing loop that occurs when packets originate from R2 addressed to an unused address on the 172.16.0.0 network. Packets that do not match any route in the table on R1, are sent using the default route to the ISP, who then resends them back to R1. This continues until TTL expires. Notice the IP address in the traceroute alternative between the ISP router (192.168.1.2) and R1 (192.168.1.1). To prevent the routing loop, a static route is added for 172.16.0.0/20, pointed to the Null0 interface on R1. Any packets addressed to the 172.16.0.0/20 network that are not in the routing table of R1 will be dropped. Example 6-15 shows the static null route configuration for R1.
IPv6 Static Routes
The static routing principles for IPv4 routes are exactly the same for IPv6. IPv6 static routes are configured with the command ipv6 route network/ prefix-length { next-hop-interface-id | [next-hop-interface-id] next-ip-address}. Figure 6-13 shows R1 and R2 with IPv6 addressing to demonstrate static routing. R1 needs a static route to R2’s 2001:db8:22::/64 network, and R2 needs a static route to R1’s 2001:d8:11::/64 network. Example 6-17 demonstrates the IPv6 static route configuration for R1 and R2.
The IPv6 routing table is displayed with the command show ipv6 route. Connectivity can be verified with the traceroute or ping command.
Other useful information: