Configuring an Independent Preference for Static Routes
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-hop statement.
![]() | Note: The preference and metric options configured by means of this statement only apply to the qualified next hops. The qualified next hop preference and metric override the route preference and metric (for that specific qualified next hop), similar to how the route preference overrides the default preference and metric (for that specific route). |
To specify an independent preference for a static route on a point-to-point interface or on an Ethernet interface, include the following statements:
For a list of hierarchy levels at which you can include these statements, see the statement summary sections for these statements.
Specify a next-hop interface by including the qualified-next-hop option. 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 0 through 4,294,967,295 (232 – 1). A lower number indicates a more preferred route. The metric value can also be a number from 0 through 4,294,967,295.
You can configure static routes on an unnumbered Ethernet interface by using the qualified-next-hop option 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:
For a list of hierarchy levels at which you can include 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 length of the static route must be 32.
- The routing device 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.
![]() | Note: The qualified-next-hop statement is mutually exclusive with all other types of next hops, except for next-hop address. Therefore, you cannot configure next-hop reject, next-hop discard, and next-hop receive with qualified-next-hop for the same destination. |
For sample configurations, see the following sections:
- Example: Configuring Independent Preferences for an IPv4 Static Route
- Example: Configuring Independent Preferences for an IPv6 Static Route
- Example: Configuring Independent Preferences for an Unnumbered Ethernet Interface
Example: Configuring Independent Preferences for an IPv4 Static Route
The following example configures:
- A static route to 0.0.0.0/8 with a next hop through 192.168.1.254, with a metric of 10 and preference of 10.
- A static route to 10.0.0.0/8 with a next hop through 192.168.1.254, with a metric of 6 and preference of 5.
- A static route to 10.0.0.0/8 with a next hop through 192.168.1.2, with a metric of 6 and preference of 7.
Example: Configuring Independent Preferences for an IPv6 Static Route
Configure the following qualified next hops:
- A static route to fec0:1:1:4::/64 with a next hop through fec0:1:1:2::1, with a metric 10 and preference 10.
- A static route to fec0:1:1:5::/64 with a next hop through fec0:1:1:2::2, with a metric 6 and preference 5.
- A static route to fec0:1:1:5::/64 with a next hop through fec0:1:1:2::3, with a metric 6 and preference 7.
Example: Configuring Independent Preferences for an Unnumbered Ethernet Interface
The following example configures two things:
- An unnumbered Ethernet interface ge-0/0/0, which borrows an IP address from donor interface lo0.
- A static route to 7.7.7.1/32 with a next hop through unnumbered interface ge-0/0/0.0 with a with a metric of 5 and preference of 6.
Hide Navigation Pane
Show Navigation Pane
Download
SHA1
