Chapter 2 - IP Static Routing
Chapter 2 - IP Static Routing
IP Static Routing
02
Module Objectives
Module Title: IP Static Routing
Configure IPv4 and IPv6 static host routes that direct traffic to a
Configure Static Host Routes
specific host.
15.1 Static Routes
Types of Static Routes
Static routes are commonly implemented on a network. This is true even when there is
a dynamic routing protocol configured.
Static routes can be configured for IPv4 and IPv6. Both protocols support the following
types of static routes:
• Standard static route
• Default static route
• Floating static route
• Summary static route
Static routes are configured using the ip route and ipv6 route global configuration
commands.
Next-Hop Options
IPv4 static routes are configured using the following global configuration
command:
IPv6 static routes are configured using the following global configuration
command:
The basic command syntax for an IPv4 default static route is as follows:
Router(config)# ip route 0.0.0.0 0.0.0.0 {ip-address | exit-intf}
IPv6 Default Static Route: The command syntax for an IPv6 default static route is similar to any
other IPv6 static route, except that the ipv6-prefix/prefix-length is ::/0, which matches all
routes.
The basic command syntax for an IPv6 default static route is as follows:
Router(config)# ipv6 route ::/0 {ipv6-address | exit-intf}
Configure a Default Static Route
The example shows an IPv4 default static route configured on R1. With the
configuration shown in the example, any packets not matching more specific
route entries are forwarded to R2 at 172.16.2.2.
Notice that the static default route configuration uses the /0 mask for IPv4 default routes. Remember
that the IPv4 subnet mask in a routing table determines how many bits must match between the
destination IP address of the packet and the route in the routing table. A /0 mask indicates that none of
the bits are required to match. As long as a more specific match does not exist, the default static route
matches all packets.
Verify a Default Static Route (Cont.)
This example shows the show ipv6 route static command output to display the contents of the routing
table.
Notice that the static default route configuration uses the ::/0 prefix for IPv6 default routes. Remember
that the IPv6 prefix-length in a routing table determines how many bits must match between the
destination IP address of the packet and the route in the routing table. A ::/0 prefix indicates that none
of the bits are required to match. As long as a more specific match does not exist, the default static
route matches all packets.
15.4 Configure Floating Static Routes
Floating Static Routes
• Another type of static route is a floating static route. Floating static routes are static
routes that are used to provide a backup path to a primary static or dynamic route.
The floating static route is only used when the primary route is not available.
• To accomplish this, the floating static route is configured with a higher
administrative distance than the primary route. The administrative distance
represents the trustworthiness of a route. If multiple paths to the destination exist,
the router will choose the path with the lowest administrative distance.
• By default, static routes have an administrative distance of 1, making them
preferable to routes learned from dynamic routing protocols.
• 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.
Configure IPv4 and IPv6 Floating Static Routes
The commands to configure default and floating IP default routes are as follows:
The show ip route and show ipv6 route output verifies that the default routes to R2 are installed in
the routing table. Note that the IPv4 floating static route to R3 is not present in the routing table.
Test the Floating Static Routes
• What would happen if R2 failed?
To simulate this, R2 shuts down
both of its serial interfaces.
• R1 automatically generates syslog
messages for the link going down.
• A look at R1’s routing table would
show the secondary route being
used.
15.5 Configure Static Host Routes
Host Routes
A host route is an IPv4 address with a 32-bit mask, or an IPv6 address with a 128-bit
mask. The following shows the three ways a host route can be added to the routing
table:
• Automatically installed when an IP address is configured on the router
• Configured as a static host route
• Host route automatically obtained through other methods (discussed in later
courses)
Automatically Installed Host Routes
• Cisco IOS automatically installs a host route, also known as a local host route, when
an interface address is configured on the router. A host route allows for a more
efficient process for packets that are directed to the router itself, rather than for
packet forwarding.
• This is in addition to the connected route, designated with a C in the routing table
for the network address of the interface.
• The local routes are marked with L in the output of the routing table.
Static Host Routes
A host route can be a manually configured static route to direct traffic to a
specific destination device, such as the server shown in the figure. The static
route uses a destination IP address and a 255.255.255.255 (/32) mask for IPv4
host routes, and a /128 prefix length for IPv6 host routes.
Configure Static Host Routes
The example shows the IPv4 and IPv6 static host route configuration on the
Branch router to access the server.
For IPv6 static routes, the next-hop address can be the link-local address of the
adjacent router. However, you must specify an interface type and an interface number
when using a link-local address as the next hop, as shown in the example. First, the
original IPv6 static host route is removed, then a fully specified route configured with
the IPv6 address of the server and the IPv6 link-local address of the ISP router.
15.6 Module Practice and Quiz
Packet Tracer – Configure IPv4 and IPv6 Static and Default Routes