Recent Posts

Friday 12 January 2018

REDistribution on Protocols

Introduction

The use of a routing protocol to advertise routes that are learned by some other means, such as by another routing protocol, static routes, or directly connected routes, is called redistribution. While running a single routing protocol throughout your entire IP inter network is desirable, multi-protocol routing is common for a number of reasons, such as company mergers, multiple departments managed by multiple network administrators, and multi-vendor environments. Running different routing protocols is often part of a network design. In any case, having a multiple protocol environment makes redistribution a necessity.
Differences in routing protocol characteristics, such as metrics, administrative distance, classful and classless capabilities can effect redistribution. Consideration must be given to these differences for redistribution to succeed.

Metrics

When you redistribute one protocol into another, remember that the metrics of each protocol play an important role in redistribution. Each protocol uses different metrics. For example, the Routing Information Protocol (RIP) metric is based on hop count, but Interior Gateway Routing Protocol (IGRP) and Enhanced Interior Gateway Routing Protocol (EIGRP) use a composite metric based on bandwidth, delay, reliability, load, and maximum transmission unit (MTU), where bandwidth and delay are the only parameters used by default. When routes are redistributed, you must define a metric that is understandable to the receiving protocol. There are two methods to define metrics when redistributing routes.
redist-a.gif
You can define the metric for that specific redistribution only:
router rip
redistribute static metric 1
redistribute ospf 1 metric 1
Or you can use the same metric as a default for all redistribution (Using the default-metriccommand saves work because it eliminates the need for defining the metric separately for each redistribution.):
router rip
redistribute static
redistribute ospf 1
default-metric 1

Administrative Distance

If a router is running more than one routing protocol and learns a route to the same destination using both routing protocols, then which route should be selected as the best route? Each protocol uses its own metric type to determine the best route. Comparing routes with different metric types cannot be done. Administrative distances take care of this problem. Administrative distances are assigned to route sources so that the route from the most preferred source will be chosen as the best path. Refer to Route Selection in Cisco Routers for more information about administrative distances and route selection.
Administrative distances help with route selection among different routing protocols, but they can cause problems for redistribution. These problems can be in the form of routing loops, convergence problems, or inefficient routing. See below for a topology and description of a possible problem.
redist-b.gif
In the above topology, if R1 is running RIP, and R2 and R5 are running both RIP and IGRP and redistributing RIP into IGRP, then there is a potential problem. For example, R2 and R5 are both learning about network 192.168.1.0 from R1 using RIP. This knowledge is redistributed into IGRP. R2 learns about network 192.168.1.0 through R3, and R5 learns about it from R4 using IGRP. IGRP has a lower administrative distance than RIP (100 versus 120); therefore, the IGRP route is what is used in the routing table. Now there is a potential routing loop. Even if split horizon, or any other feature meant to help prevent routing loops comes into play, there is still a convergence problem.
If R2 and R5 are also redistributing IGRP into RIP (otherwise known as mutual redistribution) and the network, 192.168.1.0, is not directly connected to R1 (R1 is learning from another router upstream from it), then there is a potential problem that R1 will learn the network from R2 or R5 with a better metric than from the original source.
Note: The mechanics of route redistribution is proprietary on Cisco routers. The rules for redistribution on a Cisco router dictate that the redistributed route be present in the routing table. It is not sufficient that the route be present in the routing topology or database. Routes with a lower Administrative Distance (AD) are always installed in the routing table. For example, if a static route is redistributed into IGRP on R5, and then IGRP subsequently redistributed into RIP on the same router (R5), the static route is not redistributed into RIP because it never got entered into the IGRP routing table. This is due to the fact that static routes have an AD of 1 and IGRP routes have an AD of 100 and the static route is installed in the routing table. In order to redistribute the static route into IGRP on R5, you need to use the redistribute static command under the router rip command.
The default behavior for RIP, IGRP and EIGRP is to advertise directly connected routes when a network statement under the routing protocol includes the connected interface subnet. There are two methods to get a connected route:
  • An interface is configured with an IP address and mask, this corresponding subnet is considered a connected route.
  • A static route is configured with only an outgoing interface, and not an IP next-hop, this is also considered a connected route.
Router#conf t
   Router(config)#ip route 10.0.77.0 255.255.255.0 ethernet 0/0
   Router(config)#end

   Router#show ip route static
   10.0.0.0/24 is subnetted, 1 subnets
   S 10.0.77.0 is directly connected, Ethernet0/0
network command configured under EIGRP, RIP or IGRP that includes (or "covers") either of these types of connected routes includes that subnet for advertisement.
For example, if an interface has address 10.0.23.1 and mask 255.255.255.0, the subnet 10.0.23.0/24 is a connected route and will be advertised by these routing protocols when a network statement is configured as follows:
router rip | igrp # | eigrp #
   network 10.0.0.0
This static route, 10.0.77.0/24, is also advertised by these routing protocols, because it is a connected route and it is "covered" by the network statement.

Redistribution Configuration Syntax and Examples

IGRP and EIGRP

This output shows an IGRP/EIGRP router redistributing static, Open Shortest Path First (OSPF), RIP, and Intermediate System-to-Intermediate System (IS-IS) routes.
router igrp/eigrp 1 
network 131.108.0.0 
redistribute static
redistribute ospf 1 
redistribute rip 
redistribute isis 
default-metric 10000 100 255 1 1500
IGRP and EIGRP need five metrics when redistributing other protocols: bandwidth, delay, reliability, load, and MTU, respectively. An example of IGRP metrics follows:


Multiple IGRP and EIGRP processes can run on the same router, with redistribution between them. For example, IGRP1 and IGRP2 can run on the same router. However, running two processes of the same protocol on the same router is rarely necessary, and can consume the router's memory and CPU.
The redistribution of IGRP/EIGRP into another IGRP/EIGRP process does not require any metric conversion, so there is no need to define metrics or use the default-metriccommand during redistribution.
A redistributed static route takes precedence over the summary route because the static route has an administrative distance of 1 whereas Eigrp summary route has an administrative distance of 5. This happens when a static route is redistributed with the use of redistribute static under the Eigrp process and the Eigrp process has a default route.

OSPF

This output shows an OSPF router redistributing static, RIP, IGRP, EIGRP, and IS-IS routes.
The OSPF metric is a cost value based on 108/ bandwidth of the link in bits/sec. For example, the OSPF cost of Ethernet is 10: 108/107 = 10
Note: If a metric is not specified, OSPF puts a default value of 20 when redistributing routes from all protocols except Border Gateway Protocol (BGP) routes, which get a metric of 1.
When there is a major net that is subnetted, you need to use the keyword subnet to redistribute protocols into OSPF. Without this keyword, OSPF only redistributes major nets that are not subnetted.
It is possible to run more than one OSPF process on the same router. However, running more than one process of the same protocol is rarely needed, and consumes the router's memory and CPU.
You do not need to define metric or use the default-metric command when redistributing one OSPF process into another.

RIP

Note: The principles in this document apply to RIP versions I and II.
This output shows a RIP router redistributing static, IGRP, EIGRP, OSPF, and IS-IS routes.
router rip 
network 131.108.0.0 
redistribute static
redistribute igrp 1 
redistribute eigrp 1 
redistribute ospf 1 
redistribute isis 
default-metric 1
The RIP metric is composed of hop count, and the maximum valid metric is 15. Anything above 15 is considered infinite; you can use 16 to describe an infinite metric in RIP. When redistributing a protocol into RIP, Cisco recommends that you use a low metric, such as 1. A high metric, such as 10, limits RIP even further. If you define a metric of 10 for redistributed routes, these routes can only be advertised to routers up to 5 hops away, at which point the metric (hop count) exceeds 15. By defining a metric of 1, you enable a route to travel the maximum number of hops in a RIP domain. But, doing this increases the possibility of routing loops if there are multiple redistribution points and a router learns about the network with a better metric from the redistribution point than from the original source, as explained in the Administrative Distance section of this document. Therefore, you have to make sure that the metric is neither too high, preventing it from being advertised to all the routers, or too low, leading to routing loops when there are multiple redistribution points.

Redistributing Static Routes Except Gateway of Last resort in RIP using Route Map

This configuration is an example of redistributing static routes except gateway of last gateway resort in RIP through route map.
Initial Configuration for this example:
router rip

version 2

network 10.0.0.0

default-information originate

no auto-summary

!

ip forward-protocol nd

ip route 0.0.0.0 0.0.0.0 10.32.32.3

ip route 10.32.42.211 255.255.255.255 192.192.192.102

ip route 10.98.0.0 255.255.255.0 10.32.32.1

ip route 10.99.0.0 255.255.255.0 10.32.32.1

ip route 10.99.99.0 255.255.255.252 10.32.32.5

ip route 67.129.103.128 255.255.255.240 10.32.31.1

ip route 156.55.231.0 255.255.255.0 10.32.32.5

ip route 172.16.28.0 255.255.252.0 10.32.32.5

ip route 192.168.248.0 255.255.255.0 10.32.32.5

ip route 199.43.0.0 255.255.255.0 10.32.32.5

ip route 204.103.0.0 255.255.255.0 10.32.32.5
Complete these steps in order to configure this:
  1. Create an access-list in order to match all networks that needs to be redistributed
    Router#show access-lists 10
    
    Standard IP access list 10
    
        10 permit 10.32.42.211
    
        20 permit 10.98.0.0, wildcard bits 0.0.0.255
    
        30 permit 10.99.0.0, wildcard bits 0.0.0.255
    
        40 permit 67.129.103.128, wildcard bits 0.0.0.15
    
        50 permit 156.55.231.0, wildcard bits 0.0.0.255
    
        60 permit 172.16.28.0, wildcard bits 0.0.3.255
    
        70 permit 192.168.248.0, wildcard bits 0.0.0.255
    
        80 permit 199.43.0.0, wildcard bits 0.0.0.255
    
        90 permit 204.103.0.0, wildcard bits 0.0.0.255
  2. Call this access-list in a route-map.
    Route-map TEST
    
     Match ip address 10
  3. Redistribute in RIP using route-map at and remove the default information originate command from the rip process.
    Router RIP
    
    version 2
    
    network 10.0.0.0
    
    redistribute static route-map TEST
    
    no auto-summary

IS-IS

This output shows an IS-IS router redistributing static, RIP, IGRP, EIGRP, and OSPF routes.
router isis 
network 49.1234.1111.1111.1111.00
redistribute static
redistribute rip metric 20 
redistribute igrp 1 metric 20 
redistribute eigrp 1 metric 20 
redistribute ospf 1 metric 20
The IS-IS metric must be between 1 and 63. There is no default-metric option in IS-IS—you should define a metric for each protocol, as shown in the example above. If no metric is specified for the routes being redistributed into IS-IS, a metric value of 0 is used by default.

Connected Routes

Redistributing directly connected networks into routing protocols is not a common practice and is not shown in any of the examples above for this reason. However, it is important to note that it can be done, both directly and indirectly. In order to directly redistribute connected routes, use the redistribute connected router configuration command. You should also define a metric in this case. You can also indirectly redistribute connected routes into routing protocols as shown in this example.
redist-cnctd.gif
In this example, Router B has two Fast Ethernet interfaces. FastEthernet 0/0 is in network 10.1.1.0/24 and FastEthernet 0/1 is in network 20.1.1.0/24. Router B is running EIGRP with Router A, and OSPF with Router C. Router B is mutually redistributing between the EIGRP and OSPF processes.
This is the pertinent configuration information for Router B:
interface FastEthernet0/0
 ip address 10.1.1.4 255.255.255.0

interface FastEthernet0/1
 ip address 20.1.1.4 255.255.255.0

router eigrp 7
 redistribute ospf 7 metric 10000 100 255 1 1500
 network 10.1.1.0 0.0.0.255
 auto-summary
 no eigrp log-neighbor-changes
!
router ospf 7
 log-adjacency-changes
 redistribute eigrp 7 subnets
 network 20.1.1.0 0.0.0.255 area 0
routerB#show ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile,B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF,IA - OSPF inter area
N1 - OSPF NSSA external type 1,N2 - OSPF NSSA external type 2
E1 - OSPF external type 1,E2 - OSPF external type 2,E - EGP
       i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2,
       ia - IS-IS inter area
       * - candidate default, U - per-user static route, o - ODR
       P - periodic downloaded static route
Gateway of last resort is not set
     20.0.0.0/24 is subnetted, 1 subnets
C       20.1.1.0 is directly connected, FastEthernet0/1
     10.0.0.0/24 is subnetted, 1 subnets
C       10.1.1.0 is directly connected, FastEthernet0/0
From the configuration and the routing table above there are three things to notice:
  • The networks in question are in Router B routing table as directly connected networks.
  • Network 10.1.1.0/24 is part of the EIGRP process and network 20.1.1.0/24 is part of the OSPF process.
  • Router B is mutually redistributing between EIGRP and OSPF.
Below are the routing tables for Routers A and C.
routerA#show ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
       i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, * - candidate default
       U - per-user static route, o - ODR
Gateway of last resort is not set
     10.0.0.0/24 is subnetted, 1 subnets
C       10.1.1.0 is directly connected, FastEthernet0
     20.0.0.0/24 is subnetted, 1 subnets
D EX    20.1.1.0 [170/284160] via 10.1.1.4, 00:07:26, FastEthernet0
routerC#show ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
       i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
       * - candidate default, U - per-user static route, o - ODR
       P - periodic downloaded static route
Gateway of last resort is not set
     20.0.0.0/24 is subnetted, 1 subnets
C       20.1.1.0 is directly connected, FastEthernet1
O E2    10.1.1.0 [110/20] via 20.1.1.4, 00:07:32, FastEthernet1

Router A has learned about network 20.1.1.0/24 via EIGRP, which is shown as an external route, because it was redistributed from OSPF into EIGRP. Router C has learned about network 10.1.1.0/24 via OSPF as an external route, because it was redistributed from EIGRP into OSPF. Although Router B is not redistributing connected networks, it does advertise the network 10.1.1.0/24, which is part of the EIGRP process redistributed into OSPF. Similarly, Router B advertises network 20.1.1.0/24, which is part of the OSPF process redistributed into EIGRP.
Refer to Redistributing Connected Networks into OSPF for more information about connected routes being redistributed into OSPF.
Note: By default, only EBGP-learned information is candidate to be redistributed into IGP when the redistibute bgp command is issued. The IBGP routes is not redistributed into IGP until the bgp redistribute-internal command is configured under the router bgp command. But precautions must be taken in order to avoid loops within the Autonomous System when IBGP routes are redistirbuted into IGP.

Avoiding Problems Due to Redistribution

In the section on administrative distance you saw how redistribution can potentially cause problems such as below optimal routing, routing loops, or slow convergence. Avoiding these types of problems is really quite simple—never announce the information originally received from routing process X back into routing process X.


Popular Posts