Configure Summary and Floating Static Routes (2.4)
Summary static routes can be used to help minimize the number of static routes in the routing table. Using summary static routes can also make management of a large number of static routes easier and less prone to errors. Floating static routes can be used as a backup route for another static route or a dynamic routing protocol.
Configure IPv4 Summary Routes (2.4.1)
A single IPv4 static summary route can be used to replace multiple static routes when those routes can be summarized with a common prefix length. The configuration of a summary static route is similar to the configuration of other IPv4 static routes.
Route Summarization (2.4.1.1)
Route summarization, also known as route aggregation, is the process of advertising a contiguous set of addresses as a single address with a less-specific, shorter subnet mask. CIDR is a form of route summarization and is synonymous with the term supernetting.
CIDR ignores the limitation of classful boundaries, and allows summarization with masks that are smaller than that of the default classful mask. This type of summarization helps reduce the number of entries in routing updates and lowers the number of entries in local routing tables. It also helps reduce bandwidth utilization for routing updates and results in faster routing table lookups.
In Figure 2-52, R1 requires a summary static route to reach networks in the range of 172.20.0.0/16 to 172.23.0.0/16.
Figure 2-52 Basic Topology
Calculate a Summary Route (2.4.1.2)
Summarizing networks into a single address and mask can be done in three steps, as shown in Figure 2-53:
- Step 1. List the networks in binary format. Figure 2-53 lists networks 172.20.0.0/16 to 172.23.0.0/16 in binary format.
- Step 2. Count the number of far left matching bits to determine the mask for the summary route. Figure 2-53 highlights the 14 far left matching bits. This is the prefix, or subnet mask, for the summarized route: /14 or 255.252.0.0.
- Step 3. Copy the matching bits and then add zero bits to determine the summarized network address. Figure 2-53 shows that the matching bits with zeros at the end results in the network address 172.20.0.0. The four networks—172.20.0.0/16, 172.21.0.0/16, 172.22.0.0/16, and 172.23.0.0/16—can be summarized into the single network address and prefix 172.20.0.0/14.
Figure 2-53 Calculating a Route Summary
Figure 2-54 displays R1 configured with a summary static route to reach networks 172.20.0.0/16 to 172.23.0.0/16.
Figure 2-54 One Summary Static Route
Summary Static Route Example (2.4.1.3)
Multiple static routes can be summarized into a single static route if:
- The destination networks are contiguous and can be summarized into a single network address.
- The multiple static routes all use the same exit interface or next-hop IP address.
Consider the example in Figure 2-55. All routers have connectivity using static routes.
Figure 2-55 Basic Topology
The following output displays the static routing table entries for R3. Notice that it has three static routes that can be summarized because they share the same two first octets.
R3# show ip route static | begin Gateway Gateway of last resort is not set 172.16.0.0/24 is subnetted, 3 subnets S 172.16.1.0 is directly connected, Serial0/0/1 S 172.16.2.0 is directly connected, Serial0/0/1 S 172.16.3.0 is directly connected, Serial0/0/1 R3#
Figure 2-56 displays the steps to summarize those three networks:
- Step 1. Write out the networks to summarize in binary.
- Step 2. To find the subnet mask for summarization, start with the far left bit, work to the right, finding all the bits that match consecutively until a column of bits that do not match is found, identifying the summary boundary.
- Step 3. Count the number of far left matching bits; in our example, it is 22. This number identifies the subnet mask for the summarized route as /22 or 255.255.252.0.
- Step 4. To find the network address for summarization, copy the matching 22 bits and add all 0 bits to the end to make 32 bits.
After the summary route is identified, replace the existing routes with the one summary route.
Figure 2-56 Summarize the Networks
The following output shows how the three existing routes are removed and then the new summary static route is configured:
R3(config)# no ip route 172.16.1.0 255.255.255.0 s0/0/1 R3(config)# no ip route 172.16.2.0 255.255.255.0 s0/0/1 R3(config)# no ip route 172.16.3.0 255.255.255.0 s0/0/1 R3(config)# ip route 172.16.0.0 255.255.252.0 s0/0/1 R3(config)#
The following output confirms that the summary static route is in the routing table of R3:
R3# show ip route static | begin Gateway Gateway of last resort is not set 172.16.0.0/22 is subnetted, 1 subnets S 172.16.0.0 is directly connected, Serial0/0/1 R3#
Configure IPv6 Summary Routes (2.4.1)
Similar to IPv4, a single IPv6 static summary route can be used to replace multiple IPv6 static routes with a common prefix length. The calculation and configuration of an IPv6 summary static route is similar to the configuration of an IPv4 static summary route.
Summarize IPv6 Network Addresses (2.4.2.1)
Aside from the fact that IPv6 addresses are 128 bits long and written in hexadecimal, summarizing IPv6 addresses is actually similar to the summarization of IPv4 addresses. It just requires a few extra steps due to the abbreviated IPv6 addresses and hex conversion.
Multiple static IPv6 routes can be summarized into a single static IPv6 route if:
- The destination networks are contiguous and can be summarized into a single network address.
- The multiple static routes all use the same exit interface or next-hop IPv6 address.
Refer to the network in Figure 2-57. R1 currently has four static IPv6 routes to reach networks 2001:DB8:ACAD:1::/64 to 2001:DB8:ACAD:4::/64.
Figure 2-57 Basic Topology
The following output displays the IPv6 static routes installed in the IPv6 routing table:
R1# show ipv6 route static IPv6 Routing Table - default - 7 entries Codes: C - Connected, L - Local, S - Static, U - Per-user Static route B - BGP, R - RIP, I1 - ISIS L1, I2 - ISIS L2 IA - ISIS interarea, IS - ISIS summary, D - EIGRP, EX - EIGRP external ND - ND Default, NDp - ND Prefix, DCE - Destination, NDr - Redirect O - OSPF Intra, OI - OSPF Inter, OE1 - OSPF ext 1, OE2 - OSPF ext 2 ON1 - OSPF NSSA ext 1, ON2 - OSPF NSSA ext 2 S 2001:DB8:ACAD:1::/64 [1/0] via 2001:DB8:FEED:1::2 S 2001:DB8:ACAD:2::/64 [1/0] via 2001:DB8:FEED:1::2 S 2001:DB8:ACAD:3::/64 [1/0] via 2001:DB8:FEED:1::2 S 2001:DB8:ACAD:4::/64 [1/0] via 2001:DB8:FEED:1::2 R1#
Calculate IPv6 Network Addresses (2.4.2.2)
Summarizing IPv6 networks into a single IPv6 prefix and prefix length can be done in seven steps as shown in Figures 2-58 to 2-64:
- Step 1. List the network addresses (prefixes) and identify the part where the addresses differ.
- Step 2. Expand the IPv6 if it is abbreviated.
- Step 3. Convert the differing section from hex to binary.
- Step 4. Count the number of far left matching bits to determine the prefix length for the summary route.
- Step 5. Copy the matching bits and then add zero bits to determine the summarized network address (prefix).
- Step 6. Convert the binary section back to hex.
- Step 7. Append the prefix of the summary route (result of Step 4).
Figure 2-58 Identify the Part Where the Addresses Differ
Figure 2-59 Identify the Part Where the Addresses Differ – Expanded View
Figure 2-60 Convert the Section from Hex to Binary
Figure 2-61 Count the Number of Far Left Matching Bits
Figure 2-62 Add Zero Bits to Determine the Summarized Network Address
Figure 2-63 Convert the Binary Section Back to Hex
Figure 2-64 Count the Number of Far Left Matching Bits
Configure an IPv6 Summary Address (2.4.2.3)
After the summary route is identified, replace the existing routes with the single summary route.
Figure 2-65 displays how the four existing routes are removed and then the new summary static IPv6 route is configured.
Figure 2-65 Remove Static Routes and Configure Summary IPv6 Route
The following output confirms that the summary static route is in the routing table of R1:
R1# show ipv6 route static IPv6 Routing Table - default - 4 entries Codes: C - Connected, L - Local, S - Static, U - Per-user Static route B - BGP, R - RIP, I1 - ISIS L1, I2 - ISIS L2 IA - ISIS interarea, IS - ISIS summary, D - EIGRP, EX - EIGRP external ND - ND Default, NDp - ND Prefix, DCE - Destination, NDr - Redirect O - OSPF Intra, OI - OSPF Inter, OE1 - OSPF ext 1, OE2 - OSPF ext 2 ON1 - OSPF NSSA ext 1, ON2 - OSPF NSSA ext 2 S 2001:DB8:ACA8::/45 [1/0] via 2001:DB8:FEED:1::2 R1#
Configure Floating Static Routes (2.4.3)
There may be times when a primary route fails due to physical layer problems, hardware issues, a misconfiguration, or many other reasons. A floating static route can be used as a backup route when there is a secondary path available.
Floating Static Routes (2.4.3.1)
Floating static routes are static routes that have an administrative distance greater than the administrative distance of another static route or dynamic routes. They are very useful when providing a backup to a primary link, as shown in Figure 2-66.
Figure 2-66 Why Configure a Floating Static Route?
By default, static routes have an administrative distance of 1, making them preferable to routes learned from dynamic routing protocols. For example, the administrative distances of some common dynamic routing protocols are:
- EIGRP = 90
- IGRP = 100
- OSPF = 110
- IS-IS = 115
- RIP = 120
The administrative distance of a static route can be increased to make the route less desirable than that of another static route or a route learned through a dynamic routing protocol. In this way, the static route “floats” and is not used when the route with the better administrative distance is active. However, if the preferred route is lost, the floating static route can take over, and traffic can be sent through this alternate route.
A floating static route can be used to provide a backup route to multiple interfaces or networks on a router. It is also encapsulation independent, meaning it can be used to forward packets out any interface, regardless of encapsulation type.
An important consideration of a floating static route is that it is affected by convergence time. A route that is continuously dropping and re-establishing a connection can cause the backup interface to be activated unnecessarily.
Configure a Floating Static Route (2.4.3.2)
IPv4 static routes are configured using the ip route global configuration command and specifying an administrative distance. If no administrative distance is configured, the default value (1) is used.
Refer to the topology in Figure 2-67. In this scenario, the preferred route from R1 is to R2. The connection to R3 should be used for backup only.
Figure 2-67 Configure a Floating Static Route to R3
R1 is configured with a default static route pointing to R2. Because no administrative distance is configured, the default value (1) is used for this static route. R1 is also configured with a floating static default pointing to R3 with an administrative distance of 5. This value is greater than the default value of 1 and, therefore, this route floats and is not present in the routing table, unless the preferred route fails.
The following output verifies that the default route to R2 is installed in the routing table. Note that the backup route to R3 is not present in the routing table.
R1# show ip route static | begin Gateway Gateway of last resort is 0.0.0.0 to network 0.0.0.0 S* 0.0.0.0/0 [1/0] via 172.16.2.2 R1#
Test the Floating Static Route (2.4.3.3)
Because the default static route on R1 to R2 has an administrative distance of 1, traffic from R1 to R3 should go through R2. The output in Figure 2-68 confirms that traffic between R1 and R3 flows through R2.
Figure 2-68 Verify the Path to the R3 LAN
What would happen if R2 failed? To simulate this failure, both serial interfaces of R2 are shut down, as shown in the following output:
R2(config)# int s0/0/0 R2(config-if)# shut *Feb 21 16:33:35.939: %LINK-5-CHANGED: Interface Serial0/0/0, changed state to admin- istratively down *Feb 21 16:33:36.939: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0/0, changed state to down R2(config-if)# int s0/0/1 R2(config-if)# shut R2(config-if)# *Feb 21 16:33:42.543: %LINK-5-CHANGED: Interface Serial0/0/1, changed state to admini- stratively down *Feb 21 16:33:43.543: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0/1, changed state to down
Notice in the following output that R1 automatically generates messages indicating that the serial interface to R2 is down. A look at the routing table verifies that the default route is now pointing to R3 using the floating static default route configured for next-hop 10.10.10.2.
*Feb 21 16:35:58.435: %LINK-3-UPDOWN: Interface Serial0/0/0, changed state to down *Feb 21 16:35:59.435: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0/0, changed state to down R1# R1# show ip route static | begin Gateway Gateway of last resort is 0.0.0.0 to network 0.0.0.0 S* 0.0.0.0/0 [5/0] via 10.10.10.2 R1#
The output confirms that traffic now flows directly between R1 and R3:
R1# traceroute 192.168.2.1 Type escape sequence to abort. Tracing the route to 192.168.2.1 VRF info: (vrf in name/id, vrf out name/id) 1 10.10.10.2 4 msec 4 msec * R1#