Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 
 

path-selection

Syntax

Hierarchy Level

Description

Configure BGP path selection.

Default

If the path-selection statement is not included in the configuration, only the multiple exit discriminators (MEDs) of routes that have the same peer ASs are compared.

Options

always-compare-med

Always compare MEDs whether or not the peer ASs of the compared routes are the same.

Note:

We recommend that you configure the always-compare-med option.

as-path-ignore

In the best-path algorithm, skip the step that compares the autonomous system (AS) path lengths. By default, the best-path algorithm evaluates the length of the AS paths and prefers the route with the shortest AS path length.

Note:

Starting with Junos OS Release 14.1R8, 14.2R7, 15.1R4, 15.1F6, and 16.1R1, the as-path-ignore option is supported for routing instances.

cisco-non-deterministic

Emulate the Cisco IOS default behavior. This mode evaluates routes in the order that they are received and does not group them according to their neighboring AS. With cisco-non-deterministic mode, the active path is always first. All inactive, but eligible, paths follow the active path and are maintained in the order in which they were received, with the most recent path first. Ineligible paths remain at the end of the list.

As an example, suppose you have three path advertisements for the 192.168.1.0 /24 route:

  • Path 1—learned through EBGP; AS Path of 65010; MED of 200

  • Path 2—learned through IBGP; AS Path of 65020; MED of 150; IGP cost of 5

  • Path 3—learned through IBGP; AS Path of 65010; MED of 100; IGP cost of 10

These advertisements are received in quick succession, within a second, in the order listed. Path 3 is received most recently, so the routing device compares it against path 2, the next most recent advertisement. The cost to the IBGP peer is better for path 2, so the routing device eliminates path 3 from contention. When comparing paths 1 and 2, the routing device prefers path 1 because it is received from an EBGP peer. This allows the routing device to install path 1 as the active path for the route.

Note:

We do not recommend using this configuration option in your network. It is provided solely for interoperability to allow all routing devices in the network to make consistent route selections.

external-router-id

Compare the router ID between external BGP paths to determine the active path.

igp-multiplier number

The multiplier value for the IGP cost to a next-hop address. This option is useful for making the MED and IGP cost comparable.

  • Range: 1 through 1000

  • Default: 1

l2vpn-use-bgp-rules

Enable routers to use both the BGP path selection algorithm and the designated forwarder path selection algorithm when selecting the preferred path to each destination in a Layer 2 VPN or VPLS routing instance. The BGP path selection algorithm is used by all of the Provider routers participating in the routing instance. The designated forwarder path selection algorithm is used by the PE router participating in the routing instance.

  • Default: By default, the designated forwarder path selection algorithm is used to select the best path to reach each destination within Layer 2 VPN and VPLS routing instances.

med-multiplier number

The multiplier value for the MED calculation. This option is useful for making the MED and IGP cost comparable.

  • Range: 1 through 1000

  • Default: 1

med-plus-igp

Add the IGP cost to the indirect next-hop destination to the MED before comparing MED values for path selection. This statement only affects best-path selection. It does not affect the advertised MED.

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.

med-plus-igp option introduced in Junos OS Release 8.1.

as-path-ignore and l2vpn-use-bgp-rules options introduced in Junos OS Release 10.2.