![]() ![]() |
9.6 | ![]() |
BGP Attributes | |
9.6.9 | ![]() |
The Local Preference attribute |
Local Preference is a well-known discretionary attribute, type code 5.
The Local Preference attribute is a degree of preference given to a
route for comparison with other routes for the same destination.
Higher Local Preference values are preferred. Local Preference, as
indicated by the name, is local to the AS and is exchanged between
IBGP peers only. Local Preference is not advertised to EBGP peers.
Routers within a multihomed AS may learn that they can reach the same destination network by way of neighbors in two or more different autonomous systems. In effect, there could be two or more exit points from the local AS to any given destination. Use the Local Preference attribute to force the BGP routers to prefer one exit point instead of another when routing to a particular destination network. Because this attribute is communicated within all BGP routers inside the AS, all BGP routers will have a common view on how to exit the AS.
Consider the environment illustrated in Figure
It is important for ANET to decide what path its outbound traffic is going to take. Of course, the network administrators for ANET prefer to use the T3 link by way of YNET in normal operation as it is a high speed link. This is where Local Preference starts. RTB can give the routes coming from YNET a Local Preference of 300, and RTA can give the routes coming from XNET a lower value, such as 200. Because both RTA and RTB are exchanging routing updates by way of IBGP, they both agree that the exit point of the AS is going to be by way of YNET. This happens because of the higher local preference. In Figure
|