Sie sind auf Seite 1von 43

Chapter 2: Static

Routing

Routing and Switching Essentials v6.0

Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 1
Chapter 2 - Sections & Objectives
2.1 Static Routing Implementation
• Explain the advantages and disadvantages of static routing.
• Explain the purpose of different types of static routes.

2.2 Configure Static and Default Routes


• Configure IPv4 and IPv6 static routes by specifying a next-hop address.
• Configure IPv4 and IPv6 default routes.
• Configure a floating static route to provide a backup connection.
• Configure IPv4 and IPv6 static host routes that direct traffic to a specific host

2.3 Troubleshoot Static and Default Route Issues


• Explain how a router processes packets when a static route is configured.
• Troubleshoot common static and default route configuration issues.

Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 2
2.1 Static Routing
Implementation

Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 3
Static Routing
Reach Remote Networks
A router can learn about
remote networks in one
of two ways:
• Manually - Remote
networks are
manually entered into
the route table using
static routes.

• Dynamically -
Remote routes are
automatically learned
using a dynamic
routing protocol.

Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 4
Static Routing
Why Use Static Routing?
Static routing provides some advantages over dynamic routing, including:
 Static routes are not advertised over the network, resulting in better
security.
 Static routes use less bandwidth than dynamic routing protocols, no
CPU cycles are used to calculate and communicate routes.
 The path a static route uses to send data is known.

Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 5
Static Routing
When to Use Static Routes
Static routing has three primary uses:
 Providing ease of routing
table maintenance in smaller
networks.
 Routing to and from stub
networks. A stub network is a
network accessed by a
single route, and the router
has no other neighbors.
 Using a single default route
to represent a path to any
network that does not have a
more specific match with
another route in the routing
table.

Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 6
Types of Static Routes
Static Route Applications
Static Routes are often used to:
 Connect to a specific network.
 Provide a Gateway of Last Resort for a stub network.
 Reduce the number of routes advertised by summarizing several
contiguous networks as one static route.
 Create a backup route in case a primary route link fails.

The following types of IPv4 and IPv6 static routes will be discussed:

• Standard static route


• Default static route
• Summary static route
• Floating static route

Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 7
Types of Static Routes
Standard Static Route

Both IPv4 and IPv6


support the configuration
of static routes. Static
routes are useful when
connecting to a specific
remote network.

The figure shows that R2


can be configured with a
static route to reach the
stub network
172.16.3.0/24.

Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 8
Types of Static Routes
Default Static Route
 A default static route is
a route that matches all
packets.
 A default route identifies
the gateway IP address
to which the router
sends all IP packets that
it does not have a
learned or static route.
 A default static route is
simply a static route
with 0.0.0.0/0 as the
destination IPv4
address.

Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 9
Types of Static Routes
Summary Static Route
To reduce the number of routing table entries, 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.

In the figure, R1 would require four separate static routes to reach the
172.20.0.0/16 to 172.23.0.0/16 networks. Instead, one summary static route can be
configured and still provide connectivity to those networks.

Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 10
Types of Static Routes
Floating Static Route
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, in the
event of a link failure.

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

Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 11
6.2 Configure
Static and Default
Routes

Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 12
Configure IPv4 Static Routes
ip route Command

Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 13
Configure IPv4 Static Routes
Next-Hop Options
The next hop can be identified by an IP address, exit
interface, or both. How the destination is specified creates
one of the three following route types:
 Next-hop route - Only the next-hop IP address is specified.
 Directly connected static route - Only the router exit
interface is specified.
 Fully specified static route - The next-hop IP address and
exit interface are specified.

Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 14
Configure IPv4 Static Routes
Configure a Next-Hop Static Route
In a next-hop static route,
only the next-hop IP
address is specified.

The exit interface is


derived from the next hop.

For example, in Figure 1,


three next-hop static
routes are configured on
R1 using the IP address of
the next hop, R2.

Before any packet is


forwarded by a router, the
routing table process must
determine the exit interface
to use to forward the
packet. This is known as
route resolvability.
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 15
Configure IPv4 Static Routes
Configure Directly Connected Static Route
When configuring a static
route, another option is to
use the exit interface to
specify the next-hop
address.

In Figure 1, three directly


connected static routes are
configured on R1 using the
exit interface.

The routing table for R1 in


Figure 2 shows that when a
packet is destined for the
192.168.2.0/24 network, R1
looks for a match in the
routing table, and finds that it
can forward the packet out of
its Serial 0/0/0 interface. No
other lookups are required.

Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 16
Configure IPv4 Static Routes
Configure a Fully Specified Static Route
• In a fully specified static
route, both the exit
interface and the next-hop
IP address are specified.

• This is another type of


static route that is used in
older IOSs, prior to CEF.

• This form of static route is


used when the exit
interface is a multi-access
interface and it is
necessary to explicitly
identify the next hop. The
next hop must be directly
connected to the specified
exit interface.

Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 17
Configure IPv4 Static Routes
Verify a Static Route

Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 18
Configure IPv4 Static Routes
Default Static Route

Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 19
Configure IPv4 Static Routes
Configure a Default Static Route

Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 20
Verify a Default Static Route
Verify a Default Static Route

Configure IPv4 Static Routes


Verify a Default Static Route

Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 21
Verify a Default Static Route
Verify a Default Static Route

Configure IPv6 Static Routes


The ipv6 route Command
Static routes for IPv6 are
configured using the ipv6
route global configuration
command.

Figure 1 shows the


simplified version of the
command syntax.

Most of parameters are


identical to the IPv4 version
of the command.
An IPv6 static route can
also be implemented as:

• Standard IPv6 static


route
• Default IPv6 static route
• Summary IPv6 static
route
• Floating IPv6 static route

Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 22
Verify a Default Static Route
Verify a Default Static Route

Configure IPv6 Static Routes


Next-Hop Options
 Next-hop static IPv6 route - Only the next-hop
IPv6 address is specified
 Directly connected static IPv6 route - Only the
router exit interface is specified
 Fully specified static IPv6 route - The next-hop
IPv6 address and exit interface are specified

Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 23
Verify a Default Static Route
Verify a Default Static Route

Configure IPv6 Static Routes


Configure a Next-Hop Static IPv6 Route

In a next-hop static route, only the next-hop IPv6 address is specified. The exit interface is
derived from the next hop. For instance, in Figure 1, three next-hop static routes are configured
on R1.
As with IPv4, before any packet is forwarded by the router, the routing table process must
resolve the route to determine the exit interface to use to forward the packet. The route
resolvability process will vary depending upon the type of forwarding mechanism being used by
the router. CEF (Cisco Express Forwarding) is the default behavior on most platforms running
IOS 12.0 or later.

Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 24
Verify a Default Static Route
Verify a Default Static Route

Configure IPv6 Static Routes


Directly Connected Static IPv6 Route
When configuring a static
route on point-to-point
networks, an alternative
to using the next-hop
IPv6 address is to specify
the exit interface.

This is an alternative
used in older IOSs or
whenever CEF is
disabled, to avoid the
recursive lookup problem.
For instance, in Figure 1,
three directly connected
static routes are
configured on R1 using
the exit interface.

Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 25
Verify a Default Static Route
Verify a Default Static Route

Configure IPv6 Static Routes


Fully Specified Static IPv6 Route

Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 26
Verify a Default Static Route
Verify a Default Static Route

Configure IPv6 Static Routes


Verify IPv6 Static Routes
In addition to ping and
traceroute, commands to
verify static routes include:
 show ipv6 route
 show ipv6 route
static
 show ipv6 route
network

Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 27
Verify a Default Static Route
Verify a Default Static Route

Configure IPv6 Default Routes


Default Static IPv6 Route

A default route is a static route that matches all packets. Instead of routers storing
routes for all of the networks in the Internet, they can store a single default route to
represent any network that is not in the routing table. A default route does not require
any left-most bits to match between the default route and the destination IPv6
address.

Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 28
Verify a Default Static Route
Verify a Default Static Route

Configure IPv6 Default Routes


Configure a Default Static IPv6 Route

Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 29
Verify a Default Static Route
Verify a Default Static Route

Configure IPv6 Default Routes


Verify a Default IPv6 Static Route
In Figure 1, the show ipv6 route
static command output displays the
contents of the routing table.
Unlike IPv4, IPv6 does not explicitly
state that the default IPv6 is the
Gateway of Last Resort.

The key to this configuration is the ::/0


mask. 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.

The ::/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 IPv6 route
matches all packets.

Figure 2 displays a successful ping to


the R3 LAN interface.
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 30
Verify a Default Static Route
Verify a Default Static Route

Configure IPv6 Default Routes


Floating Static Routes
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 the figure.

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

Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 31
Verify a Default Static Route
Verify a Default Static Route

Configure IPv6 Default Routes


Configure an IPv4 Floating Static Route
IPv4 floating 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 1. In this scenario,
the preferred default
route from R1 is to R2.
The connection to R3
should be used for
backup only.

Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 32
Verify a Default Static Route
Verify a Default Static Route

Configure IPv6 Default Routes


Test the IPv4 Floating Static Route
To test a floating static route:
 Use the show ip route command to verify that the routing table is
using the default static route.
 Use the traceroute command to follow the traffic flow out the
primary route.
 Disconnect the link or shutdown the primary interface(s). In the
curriculum example the serial interfaces on R2 are shutdown.
 Use a show ip route command to verify that the routing table is
using the floating static route.
 Use a traceroute command to follow the traffic flow out the
backup route.

Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 33
Verify a Default Static Route
Verify a Default Static Route

Configure Static Host Routes


Automatically Installed Host Routes

A host route is an IPv4


address with a 32-bit
mask or an IPv6 address
with a 128-bit mask.
 Automatically installed
when an IP address is
configured on the
router.
 The local routes are
marked with “L” in the
output of the routing
table.

Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 34
Verify a Default Static Route
Verify a Default Static Route

Configure Static Host Routes


Configure IPv4 and IPv6 Static Host Routes

Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 35
Verify a Default Static Route
Verify a Default Static Route

Configure Static Host Routes


Configure IPv4 and IPv6 Static Host Routes

Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 36
6.2 Troubleshoot Static
and Default Route Issues

Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 37
Verify a Default Static Route

Packet Processing with Static Routes


Static Routes and Packet Forwarding

Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 38
Verify a Default Static Route

Troubleshoot IPv4 Static and Default Route Configuration


Troubleshoot a Missing Route
IOS troubleshooting
commands include:
 ping
 Extended ping enables you
to specify the source IP
address for the ping packets.
 traceroute
 show ip route
 show ip interface
brief
 show cdp neighbors
detail

Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 39
Verify a Default Static Route

Packet Processing with Static Routes


Solve a Connectivity Problem
 Finding a missing (or misconfigured) route requires using the right tools
in a methodical manner.
 Use the ping command to confirm the destination can’t be reached.
 A traceroute would also reveal the closest router (or hop) that fails to
respond as expected. In this case, the router would then send an
Internet Control Message Protocol (ICMP) destination unreachable
message back to the source.
 The next step is to investigate the routing table using the show ip route
command. Look for missing or misconfigured routes.
 Incorrect static routes are a common cause of routing problems.

Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 40
2.4 Chapter
Summary

Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 41
Chapter Summary
Summary
• Explain the advantages and disadvantages of static routing.
• Explain the purpose of different types of static routes.
• Configure IPv4 and IPv6 static routes by specifying a next-hop
address.
• Configure IPv4 and IPv6 default routes.
• Configure a floating static route to provide a backup connection.
• Configure IPv4 and IPv6 static host routes that direct traffic to a
specific host.
• Explain how a router processes packets when a static route is
configured.
• Troubleshoot common static and default route configuration issues.

Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 42
Presentation_ID © 2008 Cisco Systems, Inc. All rights reserved. Cisco Confidential 44

Das könnte Ihnen auch gefallen