Tải bản đầy đủ (.pdf) (10 trang)

CCNA 1 and 2 Companion Guide, Revised (Cisco Networking Academy Program) part 72 pot

Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (471.21 KB, 10 trang )

Routing Basics 679
■ Routing protocol—Protocol that supports a routed protocol by providing mech-
anisms for sharing routing information. Routing protocol messages move between
the routers. A routing protocol allows the routers to communicate with other
routers to update and maintain tables. TCP/IP examples of routing protocols are
listed here:
— Routing Information Protocol (RIP)
— Interior Gateway Routing Protocol (IGRP)
— Enhanced Interior Gateway Routing Protocol (EIGRP)
— Open Shortest Path First (OSPF)
Figure 15-4 Router and Routing Protocols
Network Layer Protocol Operations
Suppose that a host application needs to send a packet to a destination on a different
network. The host addresses the data link frame to the router, using the address of one
of the router’s interfaces. The router’s network layer process examines the incoming
packet’s Layer 3 header to determine the destination network and then references the
routing table, which associates networks to outgoing interfaces (see Figure 15-5). The
packet is encapsulated again in the data link frame that is appropriate for the selected
interface and is queued for delivery to the next hop in the path.
Destination
Network
1.0
2.0
3.0
Exit Port
to Use
1.1
2.1
3.1
Routed Protocol
(Example: IP)


Routing Protocol
(Examples: RIP, IGRP)
Network
Protocol
Protocol Name
1102.book Page 679 Tuesday, May 20, 2003 2:53 PM
680 Chapter 15: Routing and Routing Protocols
Figure 15-5 Router Services
This process occurs each time that the packet is forwarded through another router.
When the packet reaches the router that is connected to the destination host’s network,
it is encapsulated in the destination LAN’s data link frame type and is delivered to the
destination host.
Multiprotocol Routing
Routers are capable of supporting multiple independent routing protocols and main-
taining routing tables for several routed protocols. This capability allows a router to
deliver packets from several routed protocols over the same data links (see Figure 15-6).
Figure 15-6 Router Traffic
X
Y
A
B
XY
ABC
C
Application
Presentation
Session
Transport
Network
Data Link

Physical
Network
Data Link
Physical
Application
Presentation
Session
Transport
Network
Data Link
Physical
Network
Data Link
Physical
Network
Data Link
Physical
Token
Ring
Token
Ring
Novell Apple
Routing Tables
IPX 3a.0800.5678.12ab
IP 15.16.50.3
AppleTalk 100.110
DECnet 10.1
IP 15.16.42.8
IP 15.17.132.6AppleTalk 200.167
DECnet 5.8

IPX 4b.0800.0121.ab13
Digital IP
1102.book Page 680 Tuesday, May 20, 2003 2:53 PM
Static Routing 681
Static Routing
Routing is nothing more than directions for getting from one network to another.
These directions, also known as routes, can be given to the router dynamically by
another router. An administrator also can statically assign these directions to the
router. This section concentrates on routes that are assigned by an administrator.
Static Versus Dynamic Routes
Static route knowledge is administered manually by a network administrator who
enters it into a router’s configuration. The administrator must update this static route
entry manually whenever an internetwork topology change requires an update.
Dynamic route knowledge works differently. After a network administrator enters
configuration commands to start dynamic routing, the route knowledge automatically
is updated by a routing process whenever new information is received from the inter-
network. Changes in dynamic knowledge are exchanged between routers as part of the
update process.
The Purpose of a Static Route
Static routing has several useful applications. Dynamic routing tends to reveal every-
thing known about an internetwork; for security reasons, however, you might want to
hide parts of an internetwork. Static routing enables you to specify the information
that you want to reveal about restricted networks.
When a network is accessible by only one path, a static route to the network can be
sufficient. This type of network is called a stub network. A stub network is an OSPF
area that carries a default route, intra-area routes, and interarea routes, but that does
not carry external routes. Configuring static routing to a stub network avoids the over-
head of dynamic routing, as shown in Figure 15-7.
Static Route Operation
Static route operations can be summarized into a three-part sequence:

1. The network administrator configures the route.
2. The router installs the route in the routing table.
3. Packets are routed using the static route.
1102.book Page 681 Tuesday, May 20, 2003 2:53 PM
682 Chapter 15: Routing and Routing Protocols
Figure 15-7 Static Route Operation
Because a static route is configured manually, the administrator must configure the
static route on the router using the ip route command. The correct syntax for the ip
route command is as follows:
Router(config)# ip route
prefix mask
{
address
|
interface
}[
distance
]
In Figure 15-8, the network administrator of the Hoboken router needs to configure
a static route pointing to the 172.16.1.0/24 and 172.16.5.0/24 networks on the other
routers.
Figure 15-8 Static Routes
B
A
Point-to-Point or
Circuit-Switched
Connection
Only a Single Network
Connection with no Need
for Routing Updates

Stub Network
1102.book Page 682 Tuesday, May 20, 2003 2:53 PM
Static Routing 683
The administrator could enter one of two commands to accomplish this objective. The
method in Example 15-1 specifies the outgoing interface (Serial 0). The method in
Example 15-2 specifies the next-hop IP address of the adjacent router (172.16.2.2).
Either of the commands installs a static route in the routing table of Hoboken. The
only difference between the two commands is in the administrative distance that the
router assigns to the route as it is placed in the routing table.
The administrative distance is an optional parameter that provides a measure of the
reliability of the route. A lower value for the administrative distance indicates a more
reliable route. This means that a route with a lower administrative distance will be
installed before an identical route with a higher administrative distance. The default
administrative distance when using next-hop address is 1. The default administrative
distance when using the outgoing interface is 0. Table 15-1 show Cisco’s administrative
distance values for each supported protocol. Routes with lower administrative distances
are trusted over identical routes with higher administrative distances. If an administra-
tive distance other than the default is desired, a value between 0 and 255 is entered
after the next-hop or outgoing interface, as follows:
ip route 172.16.3.0 255.255.255.0 192.168.2.1 255
Example 15-1 IP Route Using Interface
Sterling(config)# ip route 172.16.3.0 255.255.255.0 s0
Example 15-2 IP Route Using Next-Hop Router IP
Sterling(config)# ip route 172.16.3.0 255.255.255.0 172.16.2.2
Table 15-1 Cisco Administrative Distances
Route Source Default Distance Values
Connected interface 0
Static route 1
Enhanced Interior Gateway Routing Protocol (EIGRP)
summary route

5
External Border Gateway Protocol (BGP) 20
Internal EIGRP 90
IGRP 100
continues
1102.book Page 683 Tuesday, May 20, 2003 2:53 PM
684 Chapter 15: Routing and Routing Protocols
If the router cannot reach the outgoing interface that is being used in the route, the
route will not be installed in the routing table. This means that if the interface is
down, the route will not be placed in the routing table.
Sometimes static routes are used for backup purposes. A static route can be configured
on a router that will be used only when the dynamically learned route has failed. To
use a static route in this manner, set the administrative distance higher than that of the
dynamic routing protocol being used.
Configuring Static Routes
This section lists the steps for configuring static routes and gives an example of a simple
network for which static routes might be configured.
Use the following steps to configure static routes:
Step 1 Determine all desired destination networks, their subnet masks, and their
gateways. A gateway can be either a local interface or a next-hop address
that leads to the desired destination.
Step 2 Enter global configuration mode.
Step 3 Type the ip route command with a destination network address and subnet
mask followed by their corresponding gateway from Step 1. Including an
administrative distance is optional.
Step 4 Repeat Step 3 for as many destination networks as were defined in Step 1.
Step 5 Exit global configuration mode.
Step 6 Save the active configuration to NVRAM by using the copy running-
config startup-config or write memory commands.
OSPF 110

Intermediate System-to-Intermediate System (IS-IS) 115
Routing Information Protocol (RIP) 120
Exterior Gateway Protocol (EGP) 140
External EIGRP 170
Internal BGP 200
Unknown 255
Table 15-1 Cisco Administrative Distances (Continued)
Route Source Default Distance Values
1102.book Page 684 Tuesday, May 20, 2003 2:53 PM
Static Routing 685
The example network in Figure 15-9 is a simple three-router configuration. Hoboken
must be configured so that it can reach the 172.16.1.0 network and the 172.16.5.0
network. Both of these networks have a subnet mask of 255.255.255.0.
Figure 15-9 Static Route Operation
Packets that have a destination network of 172.16.1.0 need to be routed to Sterling. Pack-
ets that have a destination address of 172.16.5.0 need to be routed to Waycross. Static
routes can be configured to accomplish this using the outgoing router interfaces (S0
and S1), as shown in Example 15-3.
Both static routes first are configured to use a local interface as the gateway to the
destination networks, as in Figure 15-10. Because the administrative distance was not
specified, it defaults to 0 when the route is installed in the routing table. Remember
that an administrative distance of 0 is the same as a directly connected network.
Example 15-3 IP Route with Outgoing Interfaces
Hoboken(config)#ip route 172.16.1.0 255.255.255.0 s1
Hoboken(config)#ip route 172.16.5.0 255.255.255.0 s0
1102.book Page 685 Tuesday, May 20, 2003 2:53 PM
686 Chapter 15: Routing and Routing Protocols
Figure 15-10 Static Routes Configured by Administrator
The same two static routes also can be configured using a next-hop address as their
gateway. The first route to the 172.16.1.0 network has a gateway of 172.16.2.1. The

second route to the 172.16.5.0 network has a gateway of 172.16.4.2. Example 15-4
shows configuring static routes using the next-hop interface address and includes
comments (preceded by !) that will show up in the configuration file. Because the
administrative distance was not specified, it defaults to 1.
Example 15-4 IP Route with Next Hop and Comment
Hoboken(config)# ip route 172.16.1.0 255.255.255.0 172.16.2.1
!This command points to Sterling's LAN
Hoboken(config)# ip route 172.16.1.0 255.255.255.0 172.16.4.2
!This command points to Waycross LAN
Lab Activity Using Static Routes
In this lab, you configure static routes between routers to allow data transfers
between them without the use of dynamic routing protocols.
1102.book Page 686 Tuesday, May 20, 2003 2:53 PM
Static Routing 687
How a Default Route Is Used
Figure 15-11 shows a use for a default route, a routing table entry that directs packets
to the next hop when that hop is not explicitly listed in the routing table. You can set
default routes as part of the static configuration.
In this example, the Company X routers possess specific knowledge of the topology of
the Company X network, but not of other networks. Maintaining knowledge of every
other network accessible by way of the Internet cloud is unnecessary and unreasonable,
if not impossible.
Instead of maintaining specific network knowledge, each router in Company X is
informed of the default route that it can use to reach any unknown destination by
directing the packet to the Internet.
Figure 15-11 Static Default Route Using Next Hop
Configuring Default Route Forwarding
Default routes route packets with destinations that do not match any of the other
routes in the routing table. Routers typically are configured with a default route for
Internet-bound traffic because it is often impractical and unnecessary to maintain

routes to all networks in the Internet. A default route is actually a special static route
that uses the following format:
ip route 0.0.0.0 0.0.0.0 [
next-hop-address
|
outgoing interface
]
Use the following steps to configure default routes:
Step 1 Enter global configuration mode.
A B
Company X
Routing Table
No entry for destination net.
Try Router B default route.
C
Internet
10.0.0.0
192.34.56.0
NOTE
The 0.0.0.0 mask,
when logically ANDed
to the destination IP
address of the packet
to be routed, always
yields the network
0.0.0.0. If the packet
does not match a more
specific route in the
routing table, it is
routed to the 0.0.0.0

network.
1102.book Page 687 Tuesday, May 20, 2003 2:53 PM
688 Chapter 15: Routing and Routing Protocols
Step 2 Type the ip route command with 0.0.0.0 for the destination network
address and 0.0.0.0 for the subnet mask. The gateway for the default
route can be either the local router interface that connects to the outside
networks or the IP address of the next-hop router. In most cases, it is pre-
ferred that the IP address of the next hop router is specified.
Step 3 Exit global configuration mode.
Step 4 Save the active configuration to NVRAM by using the copy running-
config startup-config command.
Earlier in this chapter, in Figure 15-8, static route configuration was demonstrated on
router Hoboken to make networks 172.16.1.0 on Sterling and 172.16.5.0 on Waycross
accessible. It should now be possible to route packets to both of these networks from
Hoboken. However, as configured, neither Sterling nor Waycross will know how to
return packets to any network that is not directly connected. A static route could be
configured on Sterling and Waycross for each of the destination networks that are not
directly connected, but on a larger network this would not be a scalable solution.
Sterling connects to all non-directly connected networks via interface s0. Waycross has
only one connection to all non-directly connected networks. This is through interface
Serial 1. A default route on both Sterling and Waycross provides routing for all packets
that are destined for networks that are not directly connected, as demonstrated in
Figure 15-12. Examples 15-5 and 15-6 show the commands necessary to define a
default static route on Waycross and Sterling, respectively.
Figure 15-12 Static Route for Waycross
Sterling
172.16.1.1/24
S0
Hoboken
172.16.3.1/24

S0
Waycross
172.16.5.1/24
S1
S1
172.16.2.1/24
172.16.2.2/24
172.16.4.1/24
172.16.4.2/24
My administrator has told me
how to reach all networks not
dirrectly connected to me.
My administrator has told me
how to reach all networks not
dirrectly connected to me.
1102.book Page 688 Tuesday, May 20, 2003 2:53 PM

×