374 Chapter 6 IP Routing
3 10.1.2.2 0 msec 0 msec 4 msec
4 10.1.6.2 4 msec 4 msec *
Since we can communicate from end to end and to each host without a problem, our static
route configuration has been successful!
Default Routing
We use default routing to send packets with a remote destination network not in the routing
table to the next-hop router. You should only use default routing on stub networks—those
with only one exit path out of the network.
In the internetworking example used in the previous section, the only routers that are considered
to be in a stub network are R1, R2, and the 871W. If you tried to put a default route
on router R3, packets wouldn’t be forwarded to the correct networks because they have more
than one interface routing to other routers. You can easily create loops with default routing,
so be careful!
To configure a default route, you use wildcards in the network address and mask locations
of a static route (as I demonstrated in the 871W configuration). In fact, you can just think of
a default route as a static route that uses wildcards instead of network and mask information.
By using a default route, you can just create one static route entry instead. This sure is easier
then typing in all those routes!
871W(config)#ip route 0.0.0.0 0.0.0.0 10.1.11.1
871W(config)#ip classless
871W(config)#do show ip route
Gateway of last resort is 10.1.11.1 to network 0.0.0.0
10.0.0.0/24 is subnetted, 2 subnets
C 10.1.11.0 is directly connected, Vlan1
C 10.1.12.0 is directly connected, Dot11Radio0
S* 0.0.0.0/0 [1/0] via 10.1.11.1
871W(config)#
If you look at the routing table, you’ll see only the two directly connected networks plus an
S*, which indicates that this entry is a candidate for a default route. I could have completed
the default route command another way:
871W(config)#ip route 0.0.0.0 0.0.0.0 vlan1
What this is telling us is that if you don’t have an entry for a network in the routing table, just
forward it out VLAN1 (which will send it out FastEthernet0/0). You can choose the IP address
of the next-hop router or the exit interface—either way, it will work the same. Remember,
I used this exit interface configuration with the R3 static route configs.
Notice also in the routing table that the gateway of last resort is now set. Even so,
there’s one more command you must be aware of when using default routes: the ip
classless command.
Configuring IP Routing in Our Network 375
All Cisco routers are classful routers, meaning they expect a default subnet mask on each
interface of the router. When a router receives a packet for a destination subnet that’s not in
the routing table, it will drop the packet by default. If you’re using default routing, you must
use the ip classless command because it is possible that no remote subnets will be in the
routing table.
Since I have version 12.4 of the IOS on my routers, the ip classless command is on by
default. If you’re using default routing and this command isn’t in your configuration, you will
need to add it if you have subnetted networks on your routers. The command is shown here:
871W(config)#ip classless
Notice that it’s a global configuration mode command. The interesting part of the ip
classless command is that without it, default routing sometimes works but sometimes
doesn’t. To be on the safe side, you should always turn on the ip classless command when
you use default routing.
There’s another command you can use to configure a gateway of last resort—the ip
default-network command. Figure 6.10 shows a network that needs to have a gateway
of last resort statement configured.
FIGURE 6 . 1 0 Configuring a gateway of last resort
Here are three commands (all providing the same solution) for adding a gateway of last
resort on the gateway router to the ISP.
Gateway(config)#ip route 0.0.0.0 0.0.0.0 217.124.6.1
Gateway(config)#ip route 0.0.0.0 0.0.0.0 s0/0
Gateway(config)#ip default-network 217.124.6.0
As I said before, all three of these commands would accomplish the goal of setting the gateway
of last resort, but there are some small differences between them. First, the exit interface
ISP
.1
217.124.6.0
.2
Gateway
376 Chapter 6 IP Routing
solution would be used over the other two solutions because it has an AD of 0. Also, the ip
default-network command would advertise the default network when you configure an IGP
(like RIP) on the router. This is so other routers in your internetwork will receive this route as
a default route automatically.
But what happens if you misconfigured a default route? Let’s take a look at the output of
a show ip route command and compare that to the network in Figure 6.11 and see if you
can find a problem:
Router#sh ip route
[output cut]
Gateway of last resort is 172.19.22.2 to network 0.0.0.0
C 172.17.22.0 is directly connected, FastEthernet0/0
C 172.18.22.0 is directly connected, Serial0/0
S* 0.0.0.0/0 [1/0] via 172.19.22.2
FIGURE 6 . 1 1 Misconfigured default route
Find anything? You can see by looking at the figure and the directly connected routes in the
routing table that the WAN link is on network 172.18.22.0 and that the default route is forwarding
all packets to the 172.19.22.0 network. This is just bad—it will never work, so the
problem is a misconfigured static (default) route.
One last thing before moving on to dynamic routing. If you have the routing table output
as shown in the following lines, what happens if the router receives a packet from 10.1.6.100
destined for host 10.1.8.5?
Corp#sh ip route
[output cut]
Gateway of last resort is 10.1.5.5 to network 0.0.0.0
R 10.1.3.0 [120/1] via 101.2.2, 00:00:00, Serial 0/0
C 10.1.2.0 is directly connected, Serial0/0
C 10.1.5.0 is directly connected, Serial0/1
C 10.1.6.0 is directly connected, Fastethernet0/0
R* 0.0.0.0/0 [120/0] via 10.1.5.5, 00:00:00 Serial 0/1
This is a tad different than what I’ve shown you up until now because the default route
is listed as R*, which means it’s a RIP-injected route. This is because someone configured the
172.18.22.0
172.17.22.0 172.31.5.0
Dynamic Routing 377
ip default-network command on a remote router as well as configuring RIP, causing RIP
to advertise this route through the internetwork as a default route. Since the destination
address is 10.1.8.5 and there is no route to network 10.1.8.0, the router would use the default
route and send the packet out serial 0/1.
Dynamic Routing
Dynamic routing is when protocols are used to find networks and update routing tables on routers.
True, this is easier than using static or default routing, but it’ll cost you in terms of router CPU processes
and bandwidth on the network links. A routing protocol defines the set of rules used by a
router when it communicates routing information between neighbor routers.
The routing protocol I’m going to talk about in this chapter is Routing Information Protocol
(RIP) versions 1 and 2, with a bit of Interior Gateway Routing Protocol (IGRP) thrown in.
Two types of routing protocols are used in internetworks: interior gateway protocols (IGPs)
and exterior gateway protocols (EGPs). IGPs are used to exchange routing information with
routers in the same autonomous system (AS). An AS is a collection of networks under a common
administrative domain, which basically means that all routers sharing the same routing table
information are in the same AS. EGPs are used to communicate between ASes. An example of
an EGP is Border Gateway Protocol (BGP), which is beyond the scope of this book.
Since routing protocols are so essential to dynamic routing, I’m going to give you the
basic information you need to know about them next. Later on in this chapter, we’ll focus
on configuration.
Routing Protocol Basics
There are some important things you should know about routing protocols before getting
deeper into RIP. Specifically, you need to understand administrative distances, the three different
kinds of routing protocols, and routing loops. We will look at each of these in more
detail in the following sections.
Administrative Distances
The administrative distance (AD) is used to rate the trustworthiness of routing information
received on a router from a neighbor router. An administrative distance is an integer from 0
to 255, where 0 is the most trusted and 255 means no traffic will be passed via this route.
If a router receives two updates listing the same remote network, the first thing the router
checks is the AD. If one of the advertised routes has a lower AD than the other, then the route
with the lowest AD will be placed in the routing table.
If both advertised routes to the same network have the same AD, then routing protocol
metrics (such as hop count or bandwidth of the lines) will be used to find the best path to the
remote network. The advertised route with the lowest metric will be placed in the routing
table. But if both advertised routes have the same AD as well as the same metrics, then the
routing protocol will load-balance to the remote network (which means that it sends packets
down each link).
378 Chapter 6 IP Routing
Table 6.2 shows the default administrative distances that a Cisco router uses to decide
which route to take to a remote network.
If a network is directly connected, the router will always use the interface connected to the
network. If you configure a static route, the router will then believe that route over any other
learned routes. You can change the administrative distance of static routes, but by default, they
have an AD of 1. In our static route configuration, the AD of each route is set at 150 or 151. This
lets us configure routing protocols without having to remove the static routes. They’ll be used as
backup routes in case the routing protocol experiences a failure of some type.
For example, if you have a static route, a RIP-advertised route, and an IGRP-advertised
route listing the same network, then by default, the router will always use the static route
unless you change the AD of the static route—which we did.
Routing Protocols
There are three classes of routing protocols:
Distance vector The distance-vector protocols find the best path to a remote network by
judging distance. Each time a packet goes through a router, that’s called a hop. The route
with the least number of hops to the network is determined to be the best route. The vector
indicates the direction to the remote network. Both RIP and IGRP are distance-vector routing
protocols. They send the entire routing table to directly connected neighbors.
Link state In link-state protocols, also called shortest-path-first protocols, the routers
each create three separate tables. One of these tables keeps track of directly attached
TABLE 6 . 2 Default Administrative Distances
Route Source Default AD
Connected interface 0
Static route 1
EIGRP 90
IGRP 100
OSPF 110
RIP 120
External EIGRP 170
Unknown 255 (this route will never be used)
Distance-Vector Routing Protocols 379
neighbors, one determines the topology of the entire internetwork, and one is used as the
routing table. Link-state routers know more about the internetwork than any distancevector
routing protocol. OSPF is an IP routing protocol that is completely link state. Linkstate
protocols send updates containing the state of their own links to all other routers on
the network.
Hybrid Hybrid protocols use aspects of both distance vector and link state—for
example, EIGRP.
There’s no set way of configuring routing protocols for use with every business. This is
something you really have to do on a case-by-case basis. If you understand how the different
routing protocols work, you can make good, solid decisions that truly meet the individual
needs of any business.
Distance-Vector Routing Protocols
The distance-vector routing algorithm passes complete routing table contents to neighboring
routers, which then combine the received routing table entries with their own routing tables to
complete the router’s routing table. This is called routing by rumor, because a router receiving
an update from a neighbor router believes the information about remote networks without actually
finding out for itself.
It’s possible to have a network that has multiple links to the same remote network, and if
that’s the case, the administrative distance of each received update is checked first. If the AD
is the same, the protocol will have to use other metrics to determine the best path to use to that
remote network.
RIP uses only hop count to determine the best path to a network. If RIP finds more than
one link with the same hop count to the same remote network, it will automatically perform
a round-robin load balancing. RIP can perform load balancing for up to six equal-cost links
(four by default).
However, a problem with this type of routing metric arises when the two links to a remote
network are different bandwidths but the same hop count. Figure 6.12, for example, shows
two links to remote network 172.16.10.0.
FIGURE 6 . 1 2 Pinhole congestion
SO SO
SO SO
Network
172.16.10.0
Router A Network Router B
172.16.30.0
T1
56K
Network
172.16.20.0
Router C Router D
Suscribirse a:
Enviar comentarios (Atom)
No hay comentarios:
Publicar un comentario