Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Community Member

OSPF metric-type 1 & 2 help in test lab

Hello

I've created a small redistribution lab:

lab1.JPG

If London1 pings New-Yorks4 loopback 172.30.1.1 it goes via New-York2 > New-York4, but the return traffic goes via Milan3, I'm used metric-type 1 so it will calculate the cost to the ASBR and onwards, but how does it get the cost of 30?

I then changed the metric cost to the default of 2 and it stays the same I would of thought the return traffic would go loopback > New-York4 > New-York2 > London1?

pic123.JPG

Thanks

13 REPLIES

OSPF metric-type 1 & 2 help in test lab

The reason why it is using the cost to Milian, is if you look at your image, you are using an Ethernet link, whereas the other link is using Serial (default 1544), so when you change the default Metric Type from 2 to 1, it will take into consideration the cost to the ASBR and add that to the cost redistributed. Therefore, it will prefer the lin kto Milan since it's Ethernet (as long as the default bandwidth values are in place) which is what I'm assuming.

OSPF Cost is calculated as below.

Reference_Bandwidth/Interface_Bandwidth

The OSPF Reference Bandwidth is 100000000bps or 100Mbps.

So 100Mbps/10Mbps = 10

The default cost for redistributed routed into OSPF is 20, that's why you are getting the cost of 30.

I hope that helps some, feel free to ask more questions

OSPF metric-type 1 & 2 help in test lab

When you changed the metric back to Type-2 did you do this for both redistribution poins or one?

There is a order of preference with OSPF, which doesn't care about cost/prefx length etc

1. Intra-area routes

2. Inter-area routes

3. External Type-1

4. External Type-2

Community Member

Re: OSPF metric-type 1 & 2 help in test lab

It was on both ASBRs

Community Member

Re: OSPF metric-type 1 & 2 help in test lab

Ah, so the cost with metric 2 is 10 (Reference_Bandwidth/Interface_Bandwidth) plus the default of 20 from the ASBR to the London1 router?

I thought from the ASBR it would also use the Reference_Bandwidth/Interface_Bandwidth on the 2 serial links to to the London1 router?

Does that make sense?

so 10 + 64 + 64 = 138

I used 100000 / 1544 to get the 64 cost.

Is there a command I can see these other costs that are not shown in in the routing table like EIGRP does with the feasible successor?

Thanks

Message was edited by: Andy White

OSPF metric-type 1 & 2 help in test lab

When the route is redistributed into OSPF, the default cost for ALL redistributed routes is 20. So for a 100Mbps link, that givses the following formula

Reference_BW/Interface_Cost (Remember by default, Reference_BW always = 100Mbps in bps form) This can be changed...

So 100000000/10000000 = 10 + (redistributed costof 20) = 30

And you are right that 1544 = a cost of 64 with default reference bandwidth.

It does that that from the serial links to the original route, but it's different whn the cost is redistributed. Since the

default cost is 20.

Once again, feel free to ask questions, I'll asnwer all that I can.

VIP Purple

Re: OSPF metric-type 1 & 2 help in test lab

Hello

Just for clarification - I can see NY4 router has two area's via to NY2 & Milan.

what area are you advertiseing  the loopback of NY4 into-   Area 24 or 34 ?

Depending on what area you originally advertise that loopback into, That would take preference to which router its get advertised into and effect the return path from London1

Also as stated the next hop from NY4 will be changed of you advertise the metric-type of ospf from milan to use type 2 whilest the metric-type one is advertised by NY2,

res

Paul

Please don't forget to rate any posts that have been helpful.

Thanks.

Please don't forget to rate any posts that have been helpful. Thanks.
Community Member

Re: OSPF metric-type 1 & 2 help in test lab

This is what I have on New-York4, I am advertising the loopback (172.30.1.x) into ospf.

router ospf 24

log-adjacency-changes

network 172.30.1.0 0.0.0.255 area 0

network 192.168.3.0 0.0.0.255 area 24

network 192.168.4.0 0.0.0.255 area 34

With regards to metric-type 1 and 2 then, so with 2 the default metric is always 20 so it doesn't care about link speeds and metric 1 uses the metric 20 still but calculates the the cost only to the ASBR and then it just adds the default of 20?

Thanks

VIP Purple

Re: OSPF metric-type 1 & 2 help in test lab

Hello

Ospf usually doesn't add the cost of intra-area metrics in calculation of its redistributed Type E2 routes unlike in Type E1 routes. - Also in the ospf path selection order Type E1 is always preferred over Type E2 routes.

However after reading this excellent blog there can be times when both intra & inter area metrics are calculated no matter if they are type E1 or E2

http://blog.ine.com/2011/04/04/understanding-ospf-external-route-path-selection/#more-4993

Res
Paul

Sent from Cisco Technical Support iPad App

Please don't forget to rate any posts that have been helpful. Thanks.
Community Member

Re: OSPF metric-type 1 & 2 help in test lab

Thanks, so:

E1 routes contains Internal cost + external cost . total cost?

E2 routes contains only external cost. Which means ASBR to external Networks and uses the default of 20?

Regards

VIP Purple

Re: OSPF metric-type 1 & 2 help in test lab

Hello

Yes thats correct

res

Paul

Please don't forget to rate any posts that have been helpful.

Thanks.

Please don't forget to rate any posts that have been helpful. Thanks.
Community Member

Re: OSPF metric-type 1 & 2 help in test lab

So E1 will ingore using the seed of 20 completely and calculate the internal cost and external cost using 100000/bandwidth?

Sorry I think I have, E1s will calculate the internal cost to the ASBR then add the default seed metric of 20?

Message was edited by: Andy White

VIP Purple

Re:OSPF metric-type 1 & 2 help in test lab

Hello

Isnt that what you just asked? If not i must of misread you last question

E1 resdistributed.cost plus intra area.cost
E2 redistrubted cost

Andy did you check out that link I posted?

Res
Paul

Sent from Cisco Technical Support Android App

Please don't forget to rate any posts that have been helpful. Thanks.

Re:OSPF metric-type 1 & 2 help in test lab

Pdriver is correct.

With E1 (Metric-Type 1) routes, the router that receives the external route (OE 1) will add the cost that was included in the Type 5 LSA (External Route), as well as the cost to reach the nearest ASBR, which is including in Type 4 LSAs.

With E2 (Metric-Type 2) routes, the router that receives the external route (OE 2) will use the cost that was included in the Type 5 LSA (External Route), b default a cost of 20.

428
Views
0
Helpful
13
Replies
CreatePlease to create content