When redistributing routes into OSPF, there are some default metric (cost) values that are good to remember if no metric configuration exists:
- Use the source route’s cost if from another OSPF process
- Cost is 1 for routes learned from BGP
- Cost is 20 for all other routes
A couple more facts to remember:
External Type 1 OSPF routes have incrementing costs.
External Type 2 OSPF routes maintain the same cost throughout the AS and are the default type when redistributing.
So, for the most part routes will be external type 2 and have a cost of 20 by default unless you are using BGP (say, for either an Internet connection or MPLS configuration), in which case those routes will have a cost of 1. If you are running two OSPF processes and redistributing between them, then the cost is carried over.
But what if you want to manipulate the cost of those routes? Here area few examples on how to go about doing that.