Home > Articles > Cisco Network Technology > General Networking > Cisco Networking Academy's Introduction to Static Routing

Cisco Networking Academy's Introduction to Static Routing

  • Sample Chapter is provided courtesy of Cisco Press.
  • Date: Mar 27, 2014.

Chapter Description

This chapter explains the types of static routes as well as the advantages and disadvantages of each type. It also addresses routing configuration and troubleshooting.

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

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:

how.jpg
  • 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

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

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

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:

how.jpg
  • 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

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

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:

how.jpg
  • 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

Figure 2-58 Identify the Part Where the Addresses Differ

Figure 2-59

Figure 2-59 Identify the Part Where the Addresses Differ – Expanded View

Figure 2-60

Figure 2-60 Convert the Section from Hex to Binary

Figure 2-61

Figure 2-61 Count the Number of Far Left Matching Bits

Figure 2-62

Figure 2-62 Add Zero Bits to Determine the Summarized Network Address

Figure 2-63

Figure 2-63 Convert the Binary Section Back to Hex

Figure 2-64

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

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

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

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

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#
6. Troubleshoot Static and Default Route Issues (2.5) | Next Section Previous Section

Cisco Press Promotional Mailings & Special Offers

I would like to receive exclusive offers and hear about products from Cisco Press and its family of brands. I can unsubscribe at any time.

Overview

Pearson Education, Inc., 221 River Street, Hoboken, New Jersey 07030, (Pearson) presents this site to provide information about Cisco Press products and services that can be purchased through this site.

This privacy notice provides an overview of our commitment to privacy and describes how we collect, protect, use and share personal information collected through this site. Please note that other Pearson websites and online products and services have their own separate privacy policies.

Collection and Use of Information

To conduct business and deliver products and services, Pearson collects and uses personal information in several ways in connection with this site, including:

Questions and Inquiries

For inquiries and questions, we collect the inquiry or question, together with name, contact details (email address, phone number and mailing address) and any other additional information voluntarily submitted to us through a Contact Us form or an email. We use this information to address the inquiry and respond to the question.

Online Store

For orders and purchases placed through our online store on this site, we collect order details, name, institution name and address (if applicable), email address, phone number, shipping and billing addresses, credit/debit card information, shipping options and any instructions. We use this information to complete transactions, fulfill orders, communicate with individuals placing orders or visiting the online store, and for related purposes.

Surveys

Pearson may offer opportunities to provide feedback or participate in surveys, including surveys evaluating Pearson products, services or sites. Participation is voluntary. Pearson collects information requested in the survey questions and uses the information to evaluate, support, maintain and improve products, services or sites; develop new products and services; conduct educational research; and for other purposes specified in the survey.

Contests and Drawings

Occasionally, we may sponsor a contest or drawing. Participation is optional. Pearson collects name, contact information and other information specified on the entry form for the contest or drawing to conduct the contest or drawing. Pearson may collect additional personal information from the winners of a contest or drawing in order to award the prize and for tax reporting purposes, as required by law.

Newsletters

If you have elected to receive email newsletters or promotional mailings and special offers but want to unsubscribe, simply email information@ciscopress.com.

Service Announcements

On rare occasions it is necessary to send out a strictly service related announcement. For instance, if our service is temporarily suspended for maintenance we might send users an email. Generally, users may not opt-out of these communications, though they can deactivate their account information. However, these communications are not promotional in nature.

Customer Service

We communicate with users on a regular basis to provide requested services and in regard to issues relating to their account we reply via email or phone in accordance with the users' wishes when a user submits their information through our Contact Us form.

Other Collection and Use of Information

Application and System Logs

Pearson automatically collects log data to help ensure the delivery, availability and security of this site. Log data may include technical information about how a user or visitor connected to this site, such as browser type, type of computer/device, operating system, internet service provider and IP address. We use this information for support purposes and to monitor the health of the site, identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents and appropriately scale computing resources.

Web Analytics

Pearson may use third party web trend analytical services, including Google Analytics, to collect visitor information, such as IP addresses, browser types, referring pages, pages visited and time spent on a particular site. While these analytical services collect and report information on an anonymous basis, they may use cookies to gather web trend information. The information gathered may enable Pearson (but not the third party web trend services) to link information with application and system log data. Pearson uses this information for system administration and to identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents, appropriately scale computing resources and otherwise support and deliver this site and its services.

Cookies and Related Technologies

This site uses cookies and similar technologies to personalize content, measure traffic patterns, control security, track use and access of information on this site, and provide interest-based messages and advertising. Users can manage and block the use of cookies through their browser. Disabling or blocking certain cookies may limit the functionality of this site.

Do Not Track

This site currently does not respond to Do Not Track signals.

Security

Pearson uses appropriate physical, administrative and technical security measures to protect personal information from unauthorized access, use and disclosure.

Children

This site is not directed to children under the age of 13.

Marketing

Pearson may send or direct marketing communications to users, provided that

  • Pearson will not use personal information collected or processed as a K-12 school service provider for the purpose of directed or targeted advertising.
  • Such marketing is consistent with applicable law and Pearson's legal obligations.
  • Pearson will not knowingly direct or send marketing communications to an individual who has expressed a preference not to receive marketing.
  • Where required by applicable law, express or implied consent to marketing exists and has not been withdrawn.

Pearson may provide personal information to a third party service provider on a restricted basis to provide marketing solely on behalf of Pearson or an affiliate or customer for whom Pearson is a service provider. Marketing preferences may be changed at any time.

Correcting/Updating Personal Information

If a user's personally identifiable information changes (such as your postal address or email address), we provide a way to correct or update that user's personal data provided to us. This can be done on the Account page. If a user no longer desires our service and desires to delete his or her account, please contact us at customer-service@informit.com and we will process the deletion of a user's account.

Choice/Opt-out

Users can always make an informed choice as to whether they should proceed with certain services offered by Cisco Press. If you choose to remove yourself from our mailing list(s) simply visit the following page and uncheck any communication you no longer want to receive: www.ciscopress.com/u.aspx.

Sale of Personal Information

Pearson does not rent or sell personal information in exchange for any payment of money.

While Pearson does not sell personal information, as defined in Nevada law, Nevada residents may email a request for no sale of their personal information to NevadaDesignatedRequest@pearson.com.

Supplemental Privacy Statement for California Residents

California residents should read our Supplemental privacy statement for California residents in conjunction with this Privacy Notice. The Supplemental privacy statement for California residents explains Pearson's commitment to comply with California law and applies to personal information of California residents collected in connection with this site and the Services.

Sharing and Disclosure

Pearson may disclose personal information, as follows:

  • As required by law.
  • With the consent of the individual (or their parent, if the individual is a minor)
  • In response to a subpoena, court order or legal process, to the extent permitted or required by law
  • To protect the security and safety of individuals, data, assets and systems, consistent with applicable law
  • In connection the sale, joint venture or other transfer of some or all of its company or assets, subject to the provisions of this Privacy Notice
  • To investigate or address actual or suspected fraud or other illegal activities
  • To exercise its legal rights, including enforcement of the Terms of Use for this site or another contract
  • To affiliated Pearson companies and other companies and organizations who perform work for Pearson and are obligated to protect the privacy of personal information consistent with this Privacy Notice
  • To a school, organization, company or government agency, where Pearson collects or processes the personal information in a school setting or on behalf of such organization, company or government agency.

Links

This web site contains links to other sites. Please be aware that we are not responsible for the privacy practices of such other sites. We encourage our users to be aware when they leave our site and to read the privacy statements of each and every web site that collects Personal Information. This privacy statement applies solely to information collected by this web site.

Requests and Contact

Please contact us about this Privacy Notice or if you have any requests or questions relating to the privacy of your personal information.

Changes to this Privacy Notice

We may revise this Privacy Notice through an updated posting. We will identify the effective date of the revision in the posting. Often, updates are made to provide greater clarity or to comply with changes in regulatory requirements. If the updates involve material changes to the collection, protection, use or disclosure of Personal Information, Pearson will provide notice of the change through a conspicuous notice on this site or other appropriate way. Continued use of the site after the effective date of a posted revision evidences acceptance. Please contact us if you have questions or concerns about the Privacy Notice or any objection to any revisions.

Last Update: November 17, 2020