In a network, there is a possibility that it is running on both OSPF and EIGRP and the route of OSPF cannot be advertised to EIGRP by itself. Similarly, routes of EIGRP cannot be advertised to OSPF by itself.
We can make use of Redistribution to advertise routes between each other.
Route Redistribution is a process that helps to exchange routing information from one routing protocol to another. It allows routes from one routing protocol to be advertised into another.
Let us see how we can redistribute routes between OSPF and EIGRP with the help of this basic topology.
Redistribution between OSPF and EIGRP
R1: –
R1(config)#interface GigabitEthernet0/0/0
R1(config-if)#ip address 192.168.12.1 255.255.255.0
R1(config-if)#no shutdown
R1(config)#interface loopback 1
R1(config-if)#ip address 1.1.1.1 255.255.255.0
R1(config-if)#exit
R1(config)#router ospf 1
R1(config-router)#network 192.168.12.0 0.0.0.255 area 0
R1(config-router)#network 1.1.1.0 0.0.0.255 area 0
R2: –
R2(config)#interface GigabitEthernet0/0/1
R2(config-if)#exit
R2(config)#interface GigabitEthernet0/0/0
R2(config-if)#ip address 192.168.23.2 255.255.255.0
R2(config-if)#no shutdown
R2(config)#interface loopback 1
R2(config-if)#ip address 2.2.2.1 255.255.255.0
R2(config)#router eigrp 1
R2(config-router)#no auto-summary
R2(config-router)#network 192.168.23.0
R2(config-router)#network 2.2.2.0
R2(config-router)#exit
R2(config)#exit
R3:-
R3(config)#interface GigabitEthernet0/0/0
R3(config-if)#ip address 192.168.12.2 255.255.255.0
R3(config-if)#no shutdown
R3(config-if)#exit
R3(config)#interface GigabitEthernet0/0/1
R3(config-if)#ip address 192.168.23.3 255.255.255.0
R3(config-if)#no shutdown
R3(config)#router ospf 1
R3(config-router)#network 192.168.12.0 0.0.0.255 area 0
R3(config-router)#exit
R3(config)#router eigrp 1
R3(config-router)#no auto-summary
R3(config-router)#network 192.168.23.0
R3(config-router)#exit
Let us see the table before redistribution.
R1#show ip route
Codes:
L – local, C – connected, S – static, 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
1.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 1.1.1.0/24 is directly connected, Loopback1
L 1.1.1.1/32 is directly connected, Loopback1
192.168.12.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.12.0/24 is directly connected, GigabitEthernet0/0/0
L 192.168.12.1/32 is directly connected, GigabitEthernet0/0/0
R2#show ip route
Codes:
L – local, C – connected, S – static, 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
2.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 2.2.2.0/24 is directly connected, Loopback1
L 2.2.2.1/32 is directly connected, Loopback1
192.168.23.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.23.0/24 is directly connected, GigabitEthernet0/0/0
L 192.168.23.2/32 is directly connected, GigabitEthernet0/0/0
R3#show ip route
Codes:
L – local, C – connected, S – static, 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
1.0.0.0/32 is subnetted, 1 subnets
O 1.1.1.1/32 [110/2] via 192.168.12.1, 00:02:27, GigabitEthernet0/0/0
2.0.0.0/24 is subnetted, 1 subnets
D 2.2.2.0/24 [90/130816] via 192.168.23.2, 00:00:37, GigabitEthernet0/0/1
192.168.12.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.12.0/24 is directly connected, GigabitEthernet0/0/0
L 192.168.12.2/32 is directly connected, GigabitEthernet0/0/0
192.168.23.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.23.0/24 is directly connected, GigabitEthernet0/0/1
L 192.168.23.3/32 is directly connected, GigabitEthernet0/0/1
Redistribution: -
R3#configure t
R3(config)#router eigrp 1
R3(config-router)#redistribute ospf ?
<1-65535> Process ID
R3(config-router)#redistribute ospf 1 ?
match Redistribution of OSPF routes
metric Metric for redistributed routes
<cr>
R3(config-router)#redistribute ospf 1 metric ?
<1-4294967295> Bandwidth metric in Kbits per second
R3(config-router)#redistribute ospf 1 metric 1000 ?
<0-4294967295> EIGRP delay metric, in 10 microsecond units
R3(config-router)#redistribute ospf 1 metric 1000 100 ?
<0-255> EIGRP reliability metric where 255 is 100% reliable
R3(config-router)#redistribute ospf 1 metric 1000 100 255 ?
<1-255> EIGRP Effective bandwidth metric (Loading) where 255 is 100% loaded
R3(config-router)#redistribute ospf 1 metric 1000 100 255 ?
<1-255> EIGRP Effective bandwidth metric (Loading) where 255 is 100% loaded
R3(config-router)#redistribute ospf 1 metric 1000 100 255 1 ?
<1-65535> EIGRP MTU of the path
R3(config-router)#redistribute ospf 1 metric 1000 100 255 1 1500
R3(config-router)#exit
R3(config)#router ospf 1
R3(config-router)#redistribute eigrp ?
<1-65535> Autonomous system number
R3(config-router)#redistribute eigrp 1
% Only classful networks will be redistributed
R3(config-router)#redistribute eigrp 1 ?
metric Metric for redistributed routes
metric-type OSPF/IS-IS exterior metric type for redistributed routes
subnets Consider subnets for redistribution into OSPF
tag Set tag for routes redistributed into OSPF
<cr>
R3(config-router)#redistribute eigrp 1 subnets ?
tag Set tag for routes redistributed into OSPF
<cr>
R3(config-router)#redistribute eigrp 1 subnets
Verification: -
R1>show ip route
Codes:
L – local, C – connected, S – static, 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
1.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 1.1.1.0/24 is directly connected, Loopback1
L 1.1.1.1/32 is directly connected, Loopback1
2.0.0.0/24 is subnetted, 1 subnets
O E2 2.2.2.0/24 [110/20] via 192.168.12.2, 00:00:27, GigabitEthernet0/0/0
192.168.12.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.12.0/24 is directly connected, GigabitEthernet0/0/0
L 192.168.12.1/32 is directly connected, GigabitEthernet0/0/0
O E2 192.168.23.0/24 [110/20] via 192.168.12.2, 00:00:46, GigabitEthernet0/0/0
R2#show ip route
Codes:
L – local, C – connected, S – static, 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
1.0.0.0/32 is subnetted, 1 subnets
D EX 1.1.1.1/32 [170/2585856] via 192.168.23.3, 00:01:40, GigabitEthernet0/0/0
2.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 2.2.2.0/24 is directly connected, Loopback1
L 2.2.2.1/32 is directly connected, Loopback1
D EX 192.168.12.0/24 [170/2585856] via 192.168.23.3, 00:01:40, GigabitEthernet0/0/0
192.168.23.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.23.0/24 is directly connected, GigabitEthernet0/0/0
L 192.168.23.2/32 is directly connected, GigabitEthernet0/0/0
R3#show ip route
Codes:
L – local, C – connected, S – static, 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
1.0.0.0/32 is subnetted, 1 subnets
O 1.1.1.1/32 [110/2] via 192.168.12.1, 00:12:55, GigabitEthernet0/0/0
2.0.0.0/24 is subnetted, 1 subnets
D 2.2.2.0/24 [90/130816] via 192.168.23.2, 00:11:05, GigabitEthernet0/0/1
192.168.12.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.12.0/24 is directly connected, GigabitEthernet0/0/0
L 192.168.12.2/32 is directly connected, GigabitEthernet0/0/0
192.168.23.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.23.0/24 is directly connected, GigabitEthernet0/0/1
L 192.168.23.3/32 is directly connected, GigabitEthernet0/0/1