Supported Platforms
Related Documentation
- ACX, J, M, MX, PTX, QFX, SRX, T Series
- Understanding BGP Path Selection
- J, M, MX, SRX, T Series
- Example: Ignoring the AS Path Attribute When Selecting the Best Path
path-selection
Syntax
Hierarchy Level
Release Information
Statement introduced before Junos OS Release 7.4.
Statement introduced in Junos OS Release 9.0 for EX Series switches.
Statement introduced in Junos OS Release 11.3 for the QFX Series.
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.
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: The as-path-ignore statement is not supported with 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
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.
The other option is explained separately.
Required Privilege Level
routing—To view this statement in the configuration.
routing-control—To add this statement to the configuration.
Related Documentation
- ACX, J, M, MX, PTX, QFX, SRX, T Series
- Understanding BGP Path Selection
- J, M, MX, SRX, T Series
- Example: Ignoring the AS Path Attribute When Selecting the Best Path
Published: 2013-08-15
Supported Platforms
Related Documentation
- ACX, J, M, MX, PTX, QFX, SRX, T Series
- Understanding BGP Path Selection
- J, M, MX, SRX, T Series
- Example: Ignoring the AS Path Attribute When Selecting the Best Path