Configure the BGP Local Preference
Internal BGP sessions use a metric called the local preference, which is carried in internal BGP update packets in the path attribute
LOCAL_PREF. This metric indicates the degree of preference for an external route. The route with the highest local preference value is preferred.The
LOCAL_PREFpath attribute is always advertised to internal BGP peers and to neighboring confederations. It is never advertised to external BGP peers. The default behavior is to not modify theLOCAL_PREFpath attribute if it is present.
By default, if a received route contains a
LOCAL_PREFpath attribute value, the value is not modified. If a BGP route is received without aLOCAL_PREFattribute, the route is handled locally (that is, it is stored in the routing table and advertised by BGP) as if it were received with aLOCAL_PREFvalue of 100. A non-BGP route that is advertised by BGP is advertised with aLOCAL_PREFvalue of 100 by default.To change the local preference metric advertised in the path attribute, include the
local-preferencestatement, specifying a value from 0 through 4,294,967,295 (232 -1):local-preferencelocal-preference;You can configure the local preference metric for all BGP groups (at the
[edit protocols bgp]hierarchy level), for all peers in a group (at the[edit protocols bgp groupgroup-name]level), or for an individual peer (at the[edit protocols bgp groupgroup-nameneighboraddress]level).