One of the many BGP attributes is the Local Preference. Seventy percent of those who are just new in BGP will ask were to apply Local Preference.

BGP Local Preference
BGP Local Preference

Local Preference is used to influence outbound traffic. The higher value is preferred over the lower one.

Let’s take an example.

Looking at my diagram, to route traffic to Dasypoda, if we have all BGP attribute set as default, what path will Apidae take? Is it going to be Colletidae (>Dasypoda ( or  Andrenidae (> Mellitinae ( -> Dasypoda ( If we didn’t set the Local Preference, it will surely go to Collitidae (>Dasypoda ( path.

BGP Local Preference
BGP Local Preference

Let us check the routing table to know why it prefers the Colletidae (>Dasypoda ( path:

As you can see, the valid best path to is through

BGP Local Preference
BGP Local Preference: show ip bgp

The question is why? Since Local Preference is not configured, BGP checks the next path selection attribute which is the AS Path. The shortest is more preferred. However, we do not want the Colletidae (>Dasypoda ( path. We want the packet to take the Andrenidae (> Mellitinae ( -> Dasypoda ( path. So how are we going to do it? Let us configure the Local Preference.

Apidae(config)#route-map PRIMARY-PATH permit 10
 Apidae(config-route-map)#set local
 Apidae(config-route-map)#set local-preference ?
 <0-4294967295> Preference value

Apidae(config-route-map)#set local-preference 250
 Apidae(config)#router bgp 65500
 Apidae(config-router)#neigh route-map PRIMARY-PATH ?
 in Apply map to incoming routes
 out Apply map to outbound routes

Apidae(config-router)#neigh route-map PRIMARY-PATH in

Now that the LOCAL PREFERENCE is changed to prefer the route to neighbor Andrenidae, the path Andrenidae (> Mellitinae ( -> Dasypoda (  is now considered as the best valid path in the BGP table.

BGP Local Preference
BGP Local Preference: show ip bgp

There is another way of manipulating the Local Preference and it is through bgp default local-preference command. Keep in mind that it is just changing the default value of Local Preference from 100 to the value you entered.

Before we end this discussion, what can you notice about this ping result?

BGP Local Preference
BGP Local Preference

We have configured the Local Preference and it works as it prefers the Andrenidae (> Mellitinae ( -> Dasypoda ( But what happened to the return traffic? We will see why on our next topic – BGP Multi-Exit Discriminator (MED).

3 comments on “BGP Local Preference Attribute: The Higher The Better”

  1. I am glad to be a visitor of this gross site, regards for this rare info!
    [url=]xnxx enana follando asu hijo[/url]

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.