4.1.5. Metric
The metric determines the best path when multiple routes exist via the same routing protocol. Lower metric = preferred.
| Protocol | Metric Based On |
|---|---|
| RIP | Hop count |
| OSPF | Cost (bandwidth-based) |
| EIGRP | Bandwidth + delay (composite) |
How OSPF totals its cost: every interface has a cost of reference bandwidth / interface bandwidth, rounded down with a minimum of 1, and the default reference is 100 Mbps. A route's metric is the sum of the outgoing interface costs along the path, including the interface on the router that owns the destination network. Because of the 100 Mbps default, FastEthernet, 1 Gbps and 10 Gbps interfaces all cost 1, so OSPF cannot tell them apart; raising the reference with auto-cost reference-bandwidth (entered under router ospf, in Mbps, set the same on every router) fixes that. When two paths to a prefix have the same total cost, OSPF installs both and load-shares across them (up to 4 equal-cost paths by default in IOS, set with maximum-paths); it does not split traffic unequally.