Redistribute EIGRP and OSPF – GNS3 Lab
In this GNS3 lab we will learn how to redistribute from EIGRP into OSPF and vice versa. Below is the topology used in this lab:
First we assign IP addresses to all interfaces on the routers. Notice the 4th octet of the IP address of each router has the same value of the name of that router (for example R2 has 2 interfaces 12.12.12.2 & 23.23.23.2; R3 has 2 interfaces 23.23.23.3 & 34.34.34.3…)
Assign IP addresses to interfaces:
R1(config)#interface f0/0 R1(config-if)#ip address 12.12.12.1 255.255.255.0 R1(config-if)#no shutdown |
R4(config-if)#interface s1/0 R4(config-if)#ip address 34.34.34.4 255.255.255.0 R4(config-if)#no shutdown R4(config)#interface f0/0 R4(config-if)#ip address 45.45.45.4 255.255.255.0 R4(config-if)#no shutdown |
R2(config)#interface f0/1 R2(config-if)#ip address 12.12.12.2 255.255.255.0 R2(config-if)#no shutdown R2(config-if)#interface f0/0 R2(config-if)#ip address 23.23.23.2 255.255.255.0 R2(config-if)#no shutdown |
R5(config)#interface f0/0 R5(config-if)#ip address 45.45.45.5 255.255.255.0 R5(config-if)#no shutdown R5(config-if)#interface f0/1 R5(config-if)#ip address 56.56.56.5 255.255.255.0 R5(config-if)#no shutdown |
R3(config)#interface f0/0 R3(config-if)#ip address 23.23.23.3 255.255.255.0 R3(config-if)#no shutdown R3(config-if)#interface s1/0 R3(config-if)#ip address 34.34.34.3 255.255.255.0 R3(config-if)#no shutdown |
R6(config)#interface f0/0 R5(config-if)#ip address 45.45.45.5 255.255.255.0 R5(config-if)#no shutdown |
Turn on EIGRP on R1, R2, R3, R4 and turn on OSPF on R4, R5, R6:
R1(config)#router eigrp 1 R1(config-router)#network 12.0.0.0 |
R4(config)#router eigrp 1 R4(config-router)#network 34.0.0.0 R4(config-router)#no auto-summary R4(config)#router ospf 1 R4(config-router)#network 45.45.45.0 0.0.0.255 area 0 |
R2(config)#router eigrp 1 R2(config-router)#network 12.0.0.0 R2(config-router)#network 23.0.0.0 R2(config-router)#no auto-summary |
R5(config)#router ospf 1 R5(config-router)#network 45.45.45.0 0.0.0.255 area 0 R5(config-router)#network 56.56.56.0 0.0.0.255 area 0 |
R3(config)#router eigrp 1 R3(config-router)#network 23.0.0.0 R3(config-router)#network 34.0.0.0 R3(config-router)#no auto-summary |
R6(config)#router ospf 1 R6(config-router)#network 56.56.56.0 0.0.0.255 area 0 |
We should check the routing table of R4 (the border router) to make sure all the routes are learned:
Redistribute EIGRP into OSPF
The routing table of R4 contains all the routes in the topology so now we will redistribute EIGRP into OSPF with the command:
R4(config)#router ospf 1 R4(config-router)#redistribute eigrp 1 |
After entering these commands we will see a warning from R4
% Only classful networks will be redistributed |
Ok, maybe our EIGRP routes have been redistributed so we should check the routing table of R5:
What? We don’t see anything we expect in the output of R5. No redistributed routes here. All are only directly connected routes!
Wait a minute! We have been warned that “only classful networks will be redistributed”. We wish to see networks 12.12.12.0/24, 23.23.23.0/24 & 34.34.34.0/24 redistributed into OSPF but they are subnets, not “classful” networks. Please notice that a “classful” network here means network with the default major subnet mask (for example: 1.0.0.0/8; 175.10.0.0/16; 200.200.0.0/24…). To prove this, we will create loopback0 interface on R2 with the IP address 2.2.2.2/8:
R2(config)#interface loopback0 R2(config-if)#ip address 2.2.2.2 255.0.0.0 //Advertise this network R2(config-if)#exit R2(config)#router eigrp 1 R2(config-router)network 2.0.0.0 |
Now we check the routing table of R5 again, the 2.0.0.0/8 network has been redistributed successfully with a O E2 (by default, a route redistributed into OSPF will have type E2 with a default metric of 20):
It is not necessary but we can check the OSPF database of R5, notice that we only see a redistributed route (Type-5) of 2.0.0.0
Therefore if we want to redistribute all subnets into OSPF, use the command:
R4(config)#router ospf 1 R4(config-router)#redistribute eigrp 1 subnets |
(The keyword subnets is only used when we redistribute from another routing protocol into OSPF)
Now all the routes appear in the routing table of R5
Ok, R5 got all the routes in EIGRP domain so we may want to ping them to test the connection. So we ping from R5 to R1:
Now the ping is not successful. We can check where the packets have been dropped with the traceroute command:
The last good router is R4, which is the border router for redistribution. Therefore we can realize that the ping is not successful because OSPF knows how to route packets but EIGRP routers don’t know where to send reply to -> We need to redistribute OSPF to EIGRP.
Redistribute OSPF into EIGRP
Unlike OSPF, we must specify five metrics when redistributing into EIGRP: bandwidth, delay, reliability, load, and MTU, respectively. Therefore our redistribute command will be like this:
R4(config)#router eigrp 1 R4(config-router)#redistribute ospf 1 metric 10000 100 255 1 1500 |
Now R1 has all the OSPF routes and they are marked with D EX:
Now all routers can ping each other.
In conclusion, from this lab we learned:
+ We should use the keyword “subnets” when redistributing into OSPF; otherwise only classful networks will be redistributed.
+ The ping will not work if we only redistribute “one-way” because the reply packets can not be sent.
+ Redistribution into EIGRP requires the metrics to be defined. The only exception is when redistributing between IGRP & EIGRP, we don’t need to assign the metrics because the metrics of these 2 routing protocols are the same.
Why did we use metrics of fastethernet 0/0 while redistributing ospf to eigrp ?
I believe we should have checked the metrics of serial 1/0 of R4???
I redistributed as 1544, 2000,255,1,1500 ???
Toxkalcan you need to use the metric of the interface sitting in OSPF domain.
The objective is to convert the metric of OSPF into the EIGRP domain
Tox …. thats right … you redistribute using the metrics of the last ospf interface