How To Configure BGP Local Preference Attribute
How To Configure BGP Local Preference Attribute
Preference Attribute
BGP attribute local preference is the second BGP attribute and it can be used
to choose the exit path for an autonomous system. Here are the details:
You can use local preference to choose the outbound external BGP
path.
You can use local preference to configure your autonomous system to select
a certain exit point. Instead of configuring weight on each router you can use
local preference because it is exchanged on all internal BGP routers. By
increasing the local preference to 800 we can make AS 1 send all traffic
towards AS 2.
A well-known discretionary BGP attribute must be recognized by all BGP
routers per RFC but its presence in a BGP update is optional.
Now let me show you how to configure local preference, here is the topology
that we will use:
In the picture above we have two autonomous systems. Router James will
advertise network 1.1.1.0/24 towards AS 2 and router Jack will have to make
a choice when it wants to reach this network. It can go through router Jim or
Jack, well see how local preference influence this.
James(config)#router bgp 1
James(config-router)#neighbor 192.168.12.2 remote-as 2
James(config-router)#neighbor 192.168.13.3 remote-as 2
James(config-router)#network 1.1.1.0 mask 255.255.255.0