Lecture #12 - Route Redistribution
Route Redistribution
Thus far we have primarily considered situations where a single interior routing protocol will be used within a given network. However, there are a number of situations where we may need to use multiple routing protocols for the same network.
In order for this to perform optimally we need to configure the router so that it shares routing information between the protocols. A router performs route redistribution whenever it advertises a route that was not learned via the same routing protocol.
For example, we could redistribute routes learned via RIP into our OSPF network, or vice versa. Route redistribution is also necessary if we want to share routing information between an interior routing protocol and an exterior routing protocol (namely BGP).
Why Would We Use Multiple Protocols?
The situations where multiple routing protocols would be used are wide and varied. In some cases it is necessary (eg. redistributing routes learned via BGP to OSPF) and in some cases it is convenience.
Possible reasons include:
- Organisational mergers (two differing network configurations).
- Multi-vendor environments (eg. EIGRP on Cisco, OSPF on Juniper).
- Network upgrades (eg. upgrade from RIP to OSPF).
- Want to use OSPF but have to support legacy hosts via RIP.
- Fault isolation.
There are also situations where it may be benefical to run multiple "domains" of the same protocol, but redistribute routes between the domains using another method (eg. static routes).
Configuring Route Redistribution
Route redistribution is configured on a per protocol basis using the
redistribute command within Cisco IOS.
For example:
router rip redistribute static redistribute ospf 1 router ospf 1 redistribute static redistribute rip
Would result in RIP advertising all routes learned via OSPF, in addition to any static routing entries. Likewise, OSPF would advertise routes learned via RIP along with any static routing entries.
Challenges with Redistribution
There are a number of challenges associated with redistribution, since we have to bridge between multiple protocols, each of which have differing designs and operation.
A number of the challenges include mapping between incompatible metrics, dealing with the same route that has been advertised by different routing protocols and avoiding routing loops that can be introduced via redistribuion.
Different Routing Metrics
Different protocols use different rules to determine their routing metric. These metrics are often incompatable with one another and there is usually no easy way to map one metric into another. For example, how many RIP hops should an OSPF cost of 340 be mapped to? What should the OSPF cost be for a static route, which by definition has no metric?
In order to work around this issue, a fixed metric is assigned for each redistributed route. This fixed metric is specified in the terms used by the routing protocol which is doing the redistribution (ie. if we're redistributing RIP into OSPF, then we specify the metric as an OSPF cost).
For example:
router rip redistribute static metric 1 Static routes, hop count = 1 redistribute ospf 1 metric 3 From OSPF process #1, hop count = 3
Or a default metric (applied to all redistributed routes):
router rip redistribute static Static routes redistribute ospf 1 From OSPF process #1 default-metric 1 hop count = 1 for all.
Getting the Right Route
Where a router learns the route to a destination from a number of sources, the router will not be able to compare mixed metrics. To solve this problem Cisco IOS introduces the concept of an Administrative Distance. This is a measure of the trustworthiness or preferences for a particular routing protocol. Cisco IOS uses the following values by default (lower values are preferred):
Connected Interface 0 Static Route 1 External BGP 20 IGRP 100 OSPF 110 IS-IS 115 RIP 120 EGP 140 Internal BGP 200 Unknown 255
The administrative distance can be changed on a "per protocol" basis and/or a
"per route basis". The distance command can be
used on a routing instance to adjust the per protocol value. For example:
router rip distance 80
If the same network is learned via multiple protocols, the router will choose the route from the protocol with the lower administrative distance. This can lead to a poor choice of route by routers at the boundary router where two protocols meet. This will need to be fixed by deliberately filtering routing updates.
Routing Loops
In the diagram below, both R1 and R2 would accept redistribute
igrp nn metric 1 statements for network "X"
in preference to the hop count of 2 learned from RIP. ie. Both R1 and R2 would
send packets for "X" into the IGRP network, probably resulting
in a routing loop (or two!).
This problem could be avoided by increasing the redistributed metric, but remember that infinity for RIP is 16 hops.
Avoiding Routing Loops
Within a group of routers running a single routing protocol, routing loops should never occur. When routing protocols are mixed and routes are being exchanged between them, it is quite easy to create a routing loop.
To reiterate: to avoid loops, the golden rule is:
"Never advertise a route back to the interface from which it was originally learned!"
We can make use of access lists to filter the routing information that is to be redistributed, thus preventing the circular advertising which leads to routing loops.
router igrp 7 network 181.16.2.0 redistribute rip metric 1 1 1 1 1 Tell IGRP the metric. distribute-list 1 in Ethernet0/0 router rip network 178.1.10.0 redistribute igrp 7 metric 2 Tell RIP the metric is 2 distribute-list 2 in Ethernet1/1 access-list 1 deny 192.168.1.0 0.0.0.255 access-list 1 permit any access-list 2 deny 181.16.2.4 0.0.0.3 access-list 2 permit any
Passive Interfaces
Another interesting problem with route redistribution relates to the fact that
a router is running multiple routing protocols. Often we will want to isolate
these routing protocols to specific interfaces. This can be achieved via the
passive-interface command. This command is used
on a specific routing instance and it stops this routing protocol from sending
routing messages out via the named interface.
For example, a router runs both RIP and EIGRP. You want EIGRP to use interface Serial0 and RIP to use interface Ethernet0/0.
router rip passive-interface Serial0 router eigrp 109 passive-interface Ethernet0/0
It is worth noting that the passive-interface
command does not stop a router from listening/receiving routing messages on
the given interface. As a result, RIP still listens for updates on interface
Serial0. In this case it is probably pointless since that interface should be
being used by EIGRP - no one should be speaking RIP on that interface.
If we wanted to prevent the router from listening and processing RIP messages on Serial0, we would need to make use of an access list and perform route filtering on this interface.
The passive-interface command can also be used
to stop routing updates from entering a slow data link. A default route would
be used to substitute for the now missing routing updates.
This command cannot be used with BGP.
Copyright © 2008-2009 Joel Sing
