preference (Routing Options)
Syntax
preference { metric-value; <type metric_type> }
Hierarchy Level
[edit logical-systems logical-system-name routing-instances routing-instance-name routing-options (aggregate | generate | static) (defaults | route)], [edit logical-systems logical-system-name routing-instances routing-instance-name routing-options rib routing-table-name (aggregate | generate | static) (defaults | route)], [edit logical-systems logical-system-name routing-options (aggregate | generate | static) (defaults | route)], [edit logical-systems logical-system-name routing-options rib routing-table-name (aggregate | generate | static) (defaults | route)], [edit routing-instances routing-instance-name routing-options (aggregate | generate | static) (defaults | route)], [edit routing-instances routing-instance-name routing-options rib routing-table-name (aggregate | generate | static) (defaults | route)], [edit routing-options (aggregate | generate | static) (defaults | route)], [edit routing-options rib routing-table-name (aggregate | generate | static) (defaults | route)]
Description
Preference value for a static, aggregate, or generated route. You also can specify a secondary preference value, as well as color values, which are even finer-grained preference values.
You can specify a primary route preference (by including the preference statement in the configuration), and a secondary preference that is used as a tiebreaker (by including the preference2 statement). You can also mark route preferences with additional route tiebreaker information by specifying a color and a tiebreaker color (by including the color and color2 statements in the configuration).
If the Junos OS routing table contains a dynamic route to a destination that has a better (lower) preference value than the static, aggregate, or generated route, the dynamic route is chosen as the active route and is installed in the forwarding table.
Options
metric_value—The metric value for an aggregate, a generated, or a static route to determine the best route among multiple routes to a destination
Range: 0 through 4,294,967,295 (232 – 1)
Default: 5 (for static routes), 130 (for aggregate and generated routes)
type metric_type—(Optional) External metric type for routes exported by OSPF. When routes are exported to OSPF, type 1 routes are advertised in type 1 externals, and routes of any other type are advertised in type 2 externals. Note that if a qualified-next-hop metric value is configured, this value overrides the route metric.
Range: 1 through 16
Required Privilege Level
routing—To view this statement in the configuration.
routing-control—To add this statement to the configuration.
Release Information
Statement introduced before Junos OS Release 7.4.