Ticker

6/recent/ticker-posts

Route Redistribution in OSPF

Redistribution is technique using which the boundary routers connecting different routing domains can exchange and advertise routing information. In this article we will learn how to redistribute any routing protocol into OSPF. Below syntax is followed. The command has to be configured in router configuration mode.

redistribute protocol [process-id] [metric metric-value] [metric-type type-value] [route-map name] [subnets] [tag tag-value]

Description:
  • protocol: For example the protocol you want to redistribute into OSPF (i.e. EIGRP, RIP, or BGP etc.)
  • process-id: This field is specifically used while redistributing the protocols EIGRP and BGP into OSPF. The value of this field is AS number in case of EIGRP and BGP and process-id in case of OSPF.
  • metric: This is an optional field  that specifies the OSPF seed metric used for the redistributed route. When redistributing any protocol into OSPF, the default metric is 20 (except for BGP routes, which have a default metric of 1).
  • metric-type: This field is optional and specifies the external link type associated with the external route advertised into the OSPF routing domain. This value can be 1 for type 1 external routes or 2 for type 2 external routes. The default is 2 or E2 route type.
  • route-map: This is again an optional field and used when when we have to do any route filtering while redistribution.
  • subnets: This is an optional field. This field specifies that subnetted routes should also be redistributed into OSPF. Only routes that are not subnetted are redistributed if the subnets keyword is not specified.
  • tag: It is again an optional 32 bit field with a  decimal value attached to each external route. The OSPF protocol itself does not use this parameter; it may be used to communicate information between OSPF autonomous system boundary routers (ASBRs).
Imp Point: When redistributing routes from other routing protocols into OSPF, the default metric is 20, the default metric-type is 2, and subnets (subnetted routes) are not redistributed by default.

Route Redistribution in OSPF

R2(config)#router ospf 1
R2(config-router)#redistribute eigrp 10 subnets route-map FILTER

Imp Point: Kindly also note that you have to configure the the route-map 'FILTER'. An empty route-map or wrong route-map configured will not allow redistribution of routes.

Using above topology, let's try a simple redistribution of EIGRP into OSPF.

R2(config)#router ospf 1
R2(config-router)#redistribute eigrp 10 subnets

When the route is redistributed into OSPF as type-1 (or E1), internal OSPF link costs are also added.  In above topology R2-R3 link cost is 10,  R1's Lo0 prefix 10.10.0.1/32 is redistributed with default seed metric of 20. While we check the route of prefix 10.10.0.1/32 on R3, total OSPF metric shows 30 (20+10).

R2(config)#router ospf 1
R2(config-router)#redistribute eigrp 10 subnets metric-type 1

R3# show ip route 10.10.0.1
Routing entry for 10.10.0.1/32
  Known via "ospf 1", distance 110, metric 30, type extern 1
  Last update from 10.10.23.2 on FastEthernet1/0, 00:00:04 ago
  Routing Descriptor Blocks:
  * 10.10.23.2, from 10.10.0.2, 00:00:04 ago, via FastEthernet1/0
      Route metric is 30, traffic share count is 1

When the route is redistributed into OSPF as type-2 (or E2), internal OSPF link costs are not added and route is propagated with default seed metric of 20.  In above topology R2-R3 link cost is 10,  R1's Lo0 prefix 10.10.0.1/32 is redistributed with default seed metric of 20. While we check the route of prefix 10.10.0.1/32 on R3, total OSPF metric shows 20 (Internal OSPF link costs are not added).

R2(config)#router ospf 1
R2(config-router)#redistribute eigrp 10 subnets metric-type 1

R3# sh ip route 10.10.0.1
Routing entry for 10.10.0.1/32
  Known via "ospf 1", distance 110, metric 20, type extern 2, forward metric 10
  Last update from 10.10.23.2 on FastEthernet1/0, 00:00:03 ago
  Routing Descriptor Blocks:
  * 10.10.23.2, from 10.10.0.2, 00:00:03 ago, via FastEthernet1/0
      Route metric is 20, traffic share count is 1


When ISIS routes are redistribued in OSPF, we have the option to include Level 1, Level 2, or both Level 1 and Level 2 routes.  If no level is specified during redistribution, all routes are redistributed.

R2(config)#router OSPF 1
R2(config-router)#redistribute isis ?
  WORD       ISO routing area tag
  level-1    IS-IS level-1 routes only
  level-1-2  IS-IS level-1 and level-2 routes
  level-2    IS-IS level-2 routes only
  metric     Metric for redistributed routes
  route-map  Route map reference
  <cr>

R2(config-router)#redistribute isis subnets

R1#show ip route 10.10.0.3
Routing entry for 10.10.0.3/32
  Known via "ospf 1", distance 110, metric 20, type extern 2, forward metric 1
  Last update from 10.10.12.2 on FastEthernet1/0, 00:00:01 ago
  Routing Descriptor Blocks:
  * 10.10.12.2, from 10.10.0.2, 00:00:01 ago, via FastEthernet1/0
      Route metric is 20, traffic share count is 1

As specified above, we didn't choose any level type while redistributing ISIS routes in OSPF, so all routes are distributed by default.


If you want to restrict the number of  redistributed, you can use the below router configuration command in OSPF.

R2(config)#router ospf 1
R2(config-router)#redistribute maximum-prefix maximum [threshold] [warning-only]

By default, we will a logging warning when a threshold of 75%  of  defined maximum value is reached.  Also, after reaching the defined maximum number, no further routes are redistributed. If the warning-only keyword is also configured, no limitation is placed on redistribution and the maximum value number simply becomes a second point where another warning messaged is logged.


Redistributing iBGP into OSPF

By default, iBGP routes are not redistribute into OSPF. We need to add  bgp redistribute-internal command under BGP router configuration.

Redistribing iBGP in OSPF
Without adding the 'bgp redistribute-internal' command  under BGP, we will not see the route for 10.10.0.1/32 on R3.

R3#show ip route 10.10.0.1
% Subnet not in table

After adding the 'bgp redistribute-internal' command under BGP, we will see the route for 10.10.0.1/32 on R3.

R2(config-if)#router bgp 100
R2(config-router)#bgp redistribute-internal

R3#show ip route 10.10.0.1
  Routing entry for 10.10.0.1/32
  Known via "ospf 1", distance 110, metric 1, type extern 2, forward metric 1
  Last update from 10.10.23.2 on FastEthernet1/0, 00:00:03 ago
  Routing Descriptor Blocks:
  * 10.10.23.2, from 10.10.0.2, 00:00:03 ago, via FastEthernet1/0
     Route metric is 1, traffic share count is 1



Click Here for other useful Route-Redistribution articles


Post a comment

0 Comments