Content

| 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.

> Note: Although routers always prefer the lowest route metric and administrative distance for a given destination, BGP routers prefer higher Local Preference values over lower ones.

Consider the environment illustrated in Figure . Suppose that company ANET has purchased Internet connections from two service providers, XNET and YNET. ANET is connected to YNET by way of a primary T3 link and to XNET by way of a backup T1 link.

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 , ANET learns route 128.213.0.0/16 by way of XNET and YNET. RTA and RTB will agree on using YNET as the exit point for destination 128.213.0.0/16 because of the higher Local Preference value of 300. The Local Preference manipulation discussed in this case affects the traffic going out of the AS and not traffic coming into the AS. Inbound traffic can still come by way of the T1 link.

| Web Links Configuring BGP http://www.cisco.com/univercd/cc/td/doc/product/ software/ios122/122cgcr/fipr_c/ipcprt2/1cfbgp.ht