Redistribution between EIGRP and OSPF

In the introduction to redistribution lesson, I explained the basics of redistribution. In this lesson, I’ll show you a basic example of how to redistribute between EIGRP and OSPF.

Configuration

Here is the topology we will use:

R1 R2 R3 Ospf Eigrp Redistribution Topology

We have three routers:

  • R1 and R2 run EIGRP.
  • R2 and R3 run OSPF.

R2 will redistribute between OSPF and EIGRP. Once that’s done, we should be able to ping between the loopback interfaces of R1 and R3.

Let’s get started!

Configurations

Want to take a look for yourself? Here you will find the startup configuration of each device.

R1

hostname R1
!
ip cef
!
interface Loopback0
 ip address 1.1.1.1 255.255.255.255
!
interface GigabitEthernet0/1
 ip address 192.168.12.1 255.255.255.0
!
end

R2

hostname R2
!
ip cef
!
interface GigabitEthernet0/1
 ip address 192.168.12.2 255.255.255.0
!
interface GigabitEthernet0/2
 ip address 192.168.23.2 255.255.255.0
!
end

R3

hostname R3
!
ip cef
!
interface Loopback0
 ip address 3.3.3.3 255.255.255.255
!
interface GigabitEthernet0/1
 ip address 192.168.23.3 255.255.255.0
!
end

Basic Routing

We’ll start with some basic routing.

EIGRP

Let’s configure EIGRP between R1 and R2:

R1(config)#router eigrp 12
R1(config-router)#no auto-summary 
R1(config-router)#network 1.1.1.1 0.0.0.0
R1(config-router)#network 192.168.12.0  
R2(config)#router eigrp 12
R2(config-router)#no auto-summary 
R2(config-router)#network 192.168.12.0

OSPF

And let’s configure OSPF between R2 and R3:

R2(config)#router ospf 1
R2(config-router)#network 192.168.23.0 0.0.0.255 area 0
R3(config)#router ospf 1
R3(config-router)#network 192.168.23.0 0.0.0.255 area 0
R3(config-router)#network 3.3.3.3 0.0.0.0 area 0

Verification

Before we continue with the redistribution, let’s make sure that our neighbor adjacencies are working:

R2#show ip eigrp neighbors 
EIGRP-IPv4 Neighbors for AS(12)
H   Address                 Interface              Hold Uptime   SRTT   RTO  Q  Seq
                                                   (sec)         (ms)       Cnt Num
0   192.168.12.1            Gi0/1                    12 00:30:58    6   100  0  2
R2#show ip ospf neighbor 

Neighbor ID     Pri   State           Dead Time   Address         Interface
3.3.3.3           1   FULL/BDR        00:00:31    192.168.23.3    GigabitEthernet0/2

R2 sees R1 as an EIGRP neighbor and R3 as an OSPF neighbor. So far so good. Do we have anything in the routing table?

R2#show ip route

      1.0.0.0/32 is subnetted, 1 subnets
D        1.1.1.1 [90/130816] via 192.168.12.1, 00:34:43, GigabitEthernet0/1
      3.0.0.0/32 is subnetted, 1 subnets
O        3.3.3.3 [110/2] via 192.168.23.3, 00:33:29, GigabitEthernet0/2
      192.168.12.0/24 is variably subnetted, 2 subnets, 2 masks
C        192.168.12.0/24 is directly connected, GigabitEthernet0/1
L        192.168.12.2/32 is directly connected, GigabitEthernet0/1
      192.168.23.0/24 is variably subnetted, 2 subnets, 2 masks
C        192.168.23.0/24 is directly connected, GigabitEthernet0/2
L        192.168.23.2/32 is directly connected, GigabitEthernet0/2

As you can see above, R2 has learned the networks on the loopback interfaces of R1 and R3.

Redistribution

We can now continue with redistribution.

Redistribute OSPF into EIGRP

First, we’ll redistribute OSPF into EIGRP. We do this under the EIGRP process:

R2(config)#router eigrp 12

Let’s take a look at the redistribute ospf options:

R2(config-router)#redistribute ospf ?
  <1-65535>  Process ID

We need to select the correct OSPF process. In our example, that’s process ID 1. There are three options you can choose from:

R2(config-router)#redistribute ospf 1 ?
  match      Redistribution of OSPF routes
  metric     Metric for redistributed routes
  route-map  Route map reference

With the match option, we can choose to redistribute only specific OSPF routes like external or internal routes. The route-map is another option only to redistribute specific OSPF routes, for example, by using an access-list.

We’ll keep it simple for now and just redistribute all OSPF routes into EIGRP. We have to specify a metric, if we don’t, redistribution fails.

EIGRP and OSPF use different metrics and there is no way to convert from one metric to another. This means we have to configure the metric ourselves.

EIGRP uses a metric that is based on bandwidth, delay, reliability, load, and MTU (even though MTU is not actually used in the calculation). Let’s check what options we have under the metric statement:

R2(config-router)#redistribute ospf 1 metric ? 
  <1-4294967295>  Bandwidth metric in Kbits per second

First, I have to specify a bandwidth metric. In our topology, R2 is the only router doing redistribution. R1 and R3 can only reach each other by going through R2 so it doesn’t matter whether the metric is high or low. We’ll keep it simple and use 1 for all metric values:

R2(config-router)#redistribute ospf 1 metric 1 ?
  <0-4294967295>  EIGRP delay metric, in 10 microsecond units
R2(config-router)#redistribute ospf 1 metric 1 1 ?
  <0-255>  EIGRP reliability metric where 255 is 100% reliable
R2(config-router)#redistribute ospf 1 metric 1 1 1 ?
  <1-255>  EIGRP Effective bandwidth metric (Loading) where 255 is 100% loaded
R2(config-router)#redistribute ospf 1 metric 1 1 1 1 ?
  <1-65535>  EIGRP MTU of the path 
R2(config-router)#redistribute ospf 1 metric 1 1 1 1 1

Redistribution from OSPF into EIGRP is now configured.

Instead of specifying the metric as I did above, you can also use the default-metric command to set a default seed metric. EIGRP will then use these values for everything you redistribute into EIGRP unless you specify the metric with the redistribute command.

Verification

Let’s verify our work. Redistribution doesn’t affect the routing table of the router doing redistribution:

R2#show ip route

      1.0.0.0/32 is subnetted, 1 subnets
D        1.1.1.1 [90/130816] via 192.168.12.1, 00:42:39, GigabitEthernet0/1
      3.0.0.0/32 is subnetted, 1 subnets
O        3.3.3.3 [110/2] via 192.168.23.3, 00:41:25, GigabitEthernet0/2
      192.168.12.0/24 is variably subnetted, 2 subnets, 2 masks
C        192.168.12.0/24 is directly connected, GigabitEthernet0/1
L        192.168.12.2/32 is directly connected, GigabitEthernet0/1
      192.168.23.0/24 is variably subnetted, 2 subnets, 2 masks
C        192.168.23.0/24 is directly connected, GigabitEthernet0/2
L        192.168.23.2/32 is directly connected, GigabitEthernet0/2

Something changed on R1 however:

R1#show ip route

      1.0.0.0/32 is subnetted, 1 subnets
C        1.1.1.1 is directly connected, Loopback0
      3.0.0.0/32 is subnetted, 1 subnets
D EX     3.3.3.3 
           [170/2560000512] via 192.168.12.2, 00:00:07, GigabitEthernet0/1
      192.168.12.0/24 is variably subnetted, 2 subnets, 2 masks
C        192.168.12.0/24 is directly connected, GigabitEthernet0/1
L        192.168.12.1/32 is directly connected, GigabitEthernet0/1
D EX  192.168.23.0/24 
           [170/2560000512] via 192.168.12.2, 00:00:07, GigabitEthernet0/1

Excellent. As you can see above, we have two external routes:

  • The loopback 0 interface of R3.
  • The network in between R2 and R3.

The metric (2560000512) is calculated based on the redistribution metric values we specified.

Redistribute EIGRP into OSPF

We are halfway there. We still need to redistribute EIGRP into OSPF. Let’s go to the OSPF process:

R2(config)#router ospf 1

And take a look at the redistribute eigrp options. Make sure you select the correct EIGRP AS number (12 in our example):

R2(config-router)#redistribute eigrp 12 ?
  metric       Metric for redistributed routes
  metric-type  OSPF/IS-IS exterior metric type for redistributed routes
  nssa-only    Limit redistributed routes to NSSA areas
  route-map    Route map reference
  subnets      Consider subnets for redistribution into OSPF
  tag          Set tag for routes redistributed into OSPF
  

There are a number of (advanced) options which we’ll ignore for now. Unlike EIGRP, we don’t have to specify a metric value here. The following command is all you need:

R2(config-router)#redistribute eigrp 12

The command above redistributes all EIGRP routes into OSPF.

Verification

The routing table of R2 remains the same:

R2#show ip route 

      1.0.0.0/32 is subnetted, 1 subnets
D        1.1.1.1 [90/130816] via 192.168.12.1, 00:12:07, GigabitEthernet0/1
      3.0.0.0/32 is subnetted, 1 subnets
O        3.3.3.3 [110/2] via 192.168.23.3, 00:11:05, GigabitEthernet0/2
      192.168.12.0/24 is variably subnetted, 2 subnets, 2 masks
C        192.168.12.0/24 is directly connected, GigabitEthernet0/1
L        192.168.12.2/32 is directly connected, GigabitEthernet0/1
      192.168.23.0/24 is variably subnetted, 2 subnets, 2 masks
C        192.168.23.0/24 is directly connected, GigabitEthernet0/2
L        192.168.23.2/32 is directly connected, GigabitEthernet0/2

But something happens on R3:

R3#show ip route

      1.0.0.0/32 is subnetted, 1 subnets
O E2     1.1.1.1 [110/20] via 192.168.23.2, 00:05:40, GigabitEthernet0/1
      3.0.0.0/32 is subnetted, 1 subnets
C        3.3.3.3 is directly connected, Loopback0
O E2  192.168.12.0/24 [110/20] via 192.168.23.2, 00:05:40, GigabitEthernet0/1
      192.168.23.0/24 is variably subnetted, 2 subnets, 2 masks
C        192.168.23.0/24 is directly connected, GigabitEthernet0/1
L        192.168.23.3/32 is directly connected, GigabitEthernet0/1

Above, you see two OSPF E2 routes with a metric of 20. The default metric-type for redistributed routes in OSPF is E2 which means that the metric remains the same throughout the OSPF network. If you had another router behind R3 running OSPF, you would still see the redistributed routes with a metric of 20.

Verification

We successfully redistributed OSPF into EIGRP and vice versa but just to be sure, let’s see if we have connectivity between R1 and R3. We can test this with a quick ping between the loopback interfaces:

R1#ping 3.3.3.3 source 1.1.1.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 3.3.3.3, timeout is 2 seconds:
Packet sent with a source address of 1.1.1.1 
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 2/2/5 ms

Great, we have full reachability.

Configurations

Want to take a look for yourself? Here you will find the configuration of each device.

run

how run
!
hostname R1
!
ip cef
!
! 
!
interface Loopback0
 ip address 1.1.1.1 255.255.255.255
!
interface GigabitEthernet0/0
 no ip address
!
interface GigabitEthernet0/1
 ip address 192.168.12.1 255.255.255.0
!
router eigrp 12
 network 1.1.1.1 0.0.0.0
 network 192.168.12.0
!
 login
 transport input none
!
end

R2

hostname R2
!
ip cef
!
! 
!
interface GigabitEthernet0/0
 no ip address
!
interface GigabitEthernet0/1
 ip address 192.168.12.2 255.255.255.0
!
interface GigabitEthernet0/2
 ip address 192.168.23.2 255.255.255.0
!
router eigrp 12
 network 192.168.12.0
 redistribute ospf 1 metric 1 1 1 1 1
!
router ospf 1
 redistribute eigrp 12 subnets
 network 192.168.23.0 0.0.0.255 area 0
!
 login
 transport input none
!
end

run

how run
!
hostname R3
!
ip cef
!
! 
!
interface Loopback0
 ip address 3.3.3.3 255.255.255.255
!
interface GigabitEthernet0/0
 no ip address
!
interface GigabitEthernet0/1
 ip address 192.168.23.3 255.255.255.0
!
router ospf 1
 network 3.3.3.3 0.0.0.0 area 0
 network 192.168.23.0 0.0.0.255 area 0
!
 login
 transport input none
!
end

Conclusion

You have now learned how to redistribute routes between EIGRP and OSPF and how to verify reachability. In other lessons, we’ll take a look at some more advanced redistribution topics.

I hope you enjoyed this lesson. If you have any questions feel free to leave a comment!

Tags: ,


Forum Replies

  1. Hello Midhul

    I’ve informed Rene to fix the ShildSquare Captcha link. However, you are still able to click it and after you perform the Captcha test, you can successfully go to the lesson. If you have any specific questions about this lesson please let us know.

    I hope this has been helpful!

    Laz

  2. Hi,
    when we decide E1 or E2 . I mean in real life scenarios when we dicde to go for E1 and E2
    Thanks

  3. Hello Sims

    I’m assuming you’re asking about External type 1 and 2 for OSPF, correct? You can find out more information about those at the following lesson:

    https://networklessons.com/cisco/ccie-enterprise-infrastructure/ospf-path-selection-explained

    Now in a real-world scenario, when we redistribute, why would we choose E1 over E2 or E2 over E1? Well, first take a look at this post to remind us of how path cost is measured for E1 and E2:

    ... Continue reading in our forum

  4. Hello, everyone!

    When we are advertising connected networks into an IGP, is it better to use the network command or the redistribute connected command?

    Thank you.

    David

1 more reply! Ask a question or join the discussion by visiting our Community Forum