Specifying an Independent Preference for a Static Route
Configuring independent preferences allows you to configure multiple static routes with different preferences and metrics to the same destination. The static route with the best preference, metric, and reachable next hop is chosen as the active route. This feature allows you to specify preference and metric on a next-hop basis using the
qualified-next-hopstatement.
To specify an independent preference for a static route on a point-to-point interface or on an Ethernet interface, include the following statements:
qualified-next-hopaddress{interfaceinterface-name;metricmetric;preferencepreference;}For a list of hierarchy levels at which you can configure these statements, see the statement summary sections for these statements.
Specify a next-hop interface by including the
qualified-next-hopoption. Specifying a next-hop interface is useful when you are creating a route to an IPv6 link-local next-hop address (which is a link-only scope address and is specific only to an interface). The preference value can be a number from 1 through 255. A lower number indicates a more preferred route. The metric value can be a number from 1 through 65,535.You can configure static routes on an unnumbered Ethernet interface by using the
qualified-next-hopoption to specify the unnumbered interface as the next-hop interface for a configured static route.To configure an unnumbered Ethernet interface as the next-hop interface for a static route and to specify independent preferences, include the following statements:
qualified-next-hopinterface-name{metricmetric;preferencepreference;}For a list of hierarchy levels at which you can configure these statements, see the statement summary sections for these statements.
Keep the following points in mind when you configure static routes for unnumbered Ethernet interfaces:
- The prefix of the static route must reside in the subnet of one of the IPv4 addresses configured on the donor interface. The donor interface is the interface from which the unnumbered Ethernet interface borrows an IP address.
- The prefix length of the static route must be 32.
- The router uses the Address Resolution Protocol (ARP) to resolve the media access control (MAC) address of the destination interface.
For information about how to configure an unnumbered Ethernet interface, see the JUNOS Network Interfaces Configuration Guide.