[Contents] [Prev] [Next] [Index] [Report an Error]

Controlling Route Preference

When the JUNOS software determines a route’s preference to become the active route, it selects the route with the lowest preference as the active route and installs this route into the forwarding table. By default, the routing software assigns a preference of 170 to routes that originated from BGP. Of all the routing protocols, BGP has the highest default preference value, which means that routes learned by BGP are the least likely to become the active route. (For more information about preferences, see Route Preferences.)

To modify the default BGP preference value, include the preference statement, specifying a value from 0 through 4,294,967,295 (232– 1):

preference preference;

For a list of hierarchy levels at which you can configure this statement, see the statement summary section for this statement.

Examples: Controlling Route Preference

Assign a preference of 160 to routes learned from the BGP system 192.168.1.1. The routing protocol process will prefer these routes over routes learned from other BGP systems, which have the default preference of 170.

[edit]
routing-options {
autonmous-system 23;
}
protocols {
bgp {
group 23 {
type external;
peer-as 56;
neighbor 192.168.1.1 {
preference 160;
}
}
}
}

Assign a preference of 140 to all routes learned by BGP systems. Because the default OSPF preference is 150, BGP routes will be preferred over those learned from OSPF.

[edit]
routing-options {
autonomous-system 23;
}
protocols {
bgp {
preference 140;
group 23 {
type external;
peer-as 56;
neighbor 192.168.1.1;
}
}
}

[Contents] [Prev] [Next] [Index] [Report an Error]