Tuesday, July 1, 2008

BGP – Local Preference

Local preference is used to prefer an exit point for local AS when there are multiple exit points. 

My topology:

R1 – FR – R2

|             |

R4 – FR – R3

R1 in AS100 and R2, R3 and R4 in AS200.

Now I want to make sure that routers in AS200 uses R4 to reach network in AS 100 using local preference.

R4(config)#access-list 1 permit
R4(config)#route-map setlocalpref permit 10
R4(config-route-map)#match ip addr 1
R4(config-route-map)#set local-preference 1000
R4(config-route-map)#route-map setlocalpref permit 20
R4(config-route-map)#router bgp 200
R4(config-router)#nei route-map setlocalpref in

The route-map should be configued in the IN direction since the local preference affects the routers within the AS.

Before and After (on R2) – show ip bgp


No comments: