cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1869
Views
12
Helpful
12
Replies

OSPF route redistribute

feroz syed
Level 3
Level 3

Hi,

when we redistribute route from other protocol or connected network to ospf domain the routes that are being redistributed from other network into OSPF will appear as E2 routes, does this affect the cost of the full path (normal from Router 1 to Router B). 2) What happen if i change the metric from E2 to E1.i think by default E2 cost is the router wich redistribute route from it path to remote path cost.
2 Accepted Solutions

Accepted Solutions

Vivek Ruhil
Cisco Employee
Cisco Employee

Hi,

By default, when you redistribute into OSPF, default metric type is E2 and the metric is 20.

It doesn't affect the metric within the OSPF domain of any link, and if you look at any route in the OSPF domain you will see same metric at all times.

If you change it to E1, then teh cost gets added along the path and is always the total cost path from originating router to the destination. At any time, no two routers will have same metric to the destination (unless cost to reach ASBR is same).

E1 route is preferred over E2 routes.

View solution in original post

Metric plays role when you have two or more OSPF routes from same OSPF process and same route type.

- When there are multiple routes available to the same network with different route types, routers use this order of preference (from highest to lowest):

1. Intra-area routes.

2. Inter-area routes.

3. External Type-1 routes.

4. External Type-2 routes.

- If there are multiple routes to a network with the same route type, the OSPF metric calculated as cost based on the bandwidth is used for selecting the best route. The route with the lowest value for cost is chosen as the best route.

E1 route gives more accurate information about metric that is why E1 gets preferred over E2 routes.

View solution in original post

12 Replies 12

Vivek Ruhil
Cisco Employee
Cisco Employee

Hi,

By default, when you redistribute into OSPF, default metric type is E2 and the metric is 20.

It doesn't affect the metric within the OSPF domain of any link, and if you look at any route in the OSPF domain you will see same metric at all times.

If you change it to E1, then teh cost gets added along the path and is always the total cost path from originating router to the destination. At any time, no two routers will have same metric to the destination (unless cost to reach ASBR is same).

E1 route is preferred over E2 routes.

Jose Jara
Level 3
Level 3

Hello,

The E1 takes into account the internal cost to reach the ASBR which is injecting the external LSA and the ASBR advertised cost. However, E2 metric is just the ASBR advertised cost, regardless of the cost to reach the ASBR.

E1s are used to choose the closest exit point, and they are also preferred than E2 in OSPF route table lookups.

Hope this helps,

Jose.

Hi,

I agree with Vivek but would like to add few point to this.

- though OSPF metric for E2 route is always constant (default 20) within ospf domain after redistribution but router takes both the redistributed cost and the cost to the ASBR into account even for E2 routes.

- But E1 routes are always preferred over E2 routes irrespective of OSPF metric.

- If you have two or more E2 routes with equal redistributed cost then cost to the ASBR comes into picture otherwise lower redistributed cost is always preferred irrespective of cost to the ASBR.

- If redistributed cost is equal, route having lower cost to the ASBR will be preferred.

- If redistributed cost and cost to the ASBR is equal , both routes can be installed in to the routing table

You can see in below output , OSPF metric is 20 and forward metric to ASBR is 10

R1#sh ip route 22.22.22.22

Routing entry for 22.22.22.22/32

  Known via "ospf 100", distance 110, metric 20, type extern 2, forward metric 10  <<<<<<<<<<

  Last update from 172.31.12.2 on Ethernet0/0, 00:00:02 ago

  Routing Descriptor Blocks:

  * 172.31.12.2, from 2.2.2.2, 00:00:02 ago, via Ethernet0/0

      Route metric is 20, traffic share count is 1

R1#

feroz syed
Level 3
Level 3

i try to change the metric cost from E2 to E1 as you said the cost is increased from 20 to 22 but don't understand why you said  that E1 route is preferred over E2 routes. In ospf the band to up the cost go down, E2 have cost 20 and E1 have cost 22. So the by changing to E1 the bandwidth will increase ?

E2 200.10.10.0/24 [110/20] via 192.168.200.2, 00:25:29, FastEthernet0/1

E1 200.10.10.0/24 [110/22] via 192.168.200.2, 00:00:04, FastEthernet0/1

Vivek Ruhil
Cisco Employee
Cisco Employee

Hi

Now if you check in routing table you will see the route with E1 metric.

They are preferred because it gives you the complete cost to the destination.


Sent from Cisco Technical Support Android App

feroz syed
Level 3
Level 3

R3#sh ip route ospf

O    192.168.150.0/24 [110/2] via 192.168.200.2, 07:41:11, FastEthernet0/1

                      [110/2] via 192.168.100.2, 07:41:11, FastEthernet0/0

     172.16.0.0/24 is subnetted, 1 subnets

O IA    172.16.1.0 [110/2] via 192.168.200.2, 07:41:11, FastEthernet0/1

     10.0.0.0/24 is subnetted, 1 subnets

O IA    10.10.1.0 [110/2] via 192.168.200.2, 07:41:11, FastEthernet0/1

O E1 200.10.10.0/24 [110/22] via 192.168.200.2, 00:43:41, FastEthernet0/1

If you see the diagram R3-->R1--->R2-->Destination (R6 Eigrp). so each router take 1 cost to reach other destination if so it should be 23 in route tabe (110/ 23)

E1 cost 22 it mean router 3 cost 1 to reach router 1, Router 1 take cost 1 to reach router 2  finally router 2 take 1 cost to reach destination .

Metric plays role when you have two or more OSPF routes from same OSPF process and same route type.

- When there are multiple routes available to the same network with different route types, routers use this order of preference (from highest to lowest):

1. Intra-area routes.

2. Inter-area routes.

3. External Type-1 routes.

4. External Type-2 routes.

- If there are multiple routes to a network with the same route type, the OSPF metric calculated as cost based on the bandwidth is used for selecting the best route. The route with the lowest value for cost is chosen as the best route.

E1 route gives more accurate information about metric that is why E1 gets preferred over E2 routes.

Hi,

OSPF cost to the destination from R3 will be 22 only, see below explanation


E1 metric = redistributed cost (20)+ cost to the ASBR (2).

               = 22

Here cost to the ASBR(R1) is 2 from R3, and redistributed cost is 20 (by default)

Regards,

Akash

feroz syed
Level 3
Level 3

Understood !! This is my first question in ccna forum got fast reply with various type of answers.  Thanks for your helpful reply guys.

fb_webuser
Level 6
Level 6

i have the same issue

---

Posted by WebUser Sanoj KV from Cisco Support Community App

Good point Akash, rate as deserved!

Thanks Jose