
Configuring IP Services
8-8
303528-A Rev 00
BGP-4 Local Preference Value
BGP-4 update messages include a local preference attribute that allows an AS
border router to assign a preference value to a route when advertising it to IBGP
peers. The calculation of the local preference attribute is specific to each
implementation. A higher value indicates that the route is more preferred.
The router uses the following equation to calculate a value for the local preference
attribute:
local preference = 8191 - origin value - AS path weight
where origin value is 0 for routes with an origin path attribute of IGP or 4096 for
other routes, and AS path weight is a sum of weight values associated with AS
numbers listed in the route’s AS Path attribute. These weight values can be
configured and default to 8.
A steep penalty is applied to routes that are advertised with an origin attribute
other than IGP -- that is, EGP or incomplete.
For an OSPF internal route or a direct route, the local preference attribute is set to:
local preference = (8191 + 256 - (metric & 255))
where metric is the OSPF metric for an OSPF route or the configured cost for a
direct route.
For a RIP route, an EGP route, an OSPF ASE route, or a static route, the local
preference attribute is set to:
local preference = (256 - metric)
where metric is the RIP metric for a RIP route, the EGP metric for an EGP route,
the OSPF metric for an OSPF ASE route, or the configured cost for a static route.
Note that local preference values for OSPF internal routes and direct routes are
higher than the local preference values calculated for BGP routes.
Kommentare zu diesen Handbüchern