The route with the best (numerically smallest) preference is preferred.
A route learned from an igp is preferred to a route learned from an egp.
Least preferred is a route learned indirectly by an igp from an egp.
If AS path information is available, it is used to help
determine the most preferred route.
AS path information is specific to the BGP protocol and is
described at
``Border Gateway Protocol (BGP)''.
A route with an AS path is preferred over one without an AS path.
If the AS paths and origins are identical, the route with the lower
metric is preferred.
A route with an AS path origin of igp is preferred over
a route with an AS path origin of egp.
Least preferred is an AS path with an unknown origin.
A route with a shorter AS path is preferred.
If both routes are from the same protocol and AS, the one with the
lowest metric is preferred.
The route with the lowest numeric next-hop address is used.