Modify the Interface Metric
All OSPF interfaces have a cost, which is a routing metric that is used in the link-state calculation. Routes with lower total path metrics are preferred over those with higher path metrics.
When several equal-cost routes to a destination exist, traffic is distributed equally among them.
The cost of a route is described by a single dimensionless metric that is determined using the following formula:
cost = reference-bandwidth/bandwidth
reference-bandwidthis the reference bandwidth. Its default value is 100 Mbps (which you specify as 100,000,000), which gives a metric of 1 for any bandwidth that is 100 Mbps or greater.To modify the metric for routes advertised from an interface, include the
metricstatement:[edit protocols (ospf | ospf3) areaarea-idinterfaceinterface-name]metricmetric;To modify the reference bandwidth, include the
reference-bandwidthstatement:[edit protocols (ospf | ospf3)]reference-bandwidthreference-bandwidth;For a list of hierarchy levels at which you can configure these statements, see the statement summary sections for these statements.
For example, if you set the reference bandwidth to 1 Gbps (that is,
reference-bandwidthis set to 1,000,000,000), a 100-Mbps interface has a default metric of 10.By default, the loopback interface (
lo0) metric is 0. No bandwidth is associated with the loopback interface.