Adjusting Local Preference Values
Problem
You want to change the Local Preference values to control which routes you use.
Solution
There are two ways to adjust Local Preference values on a router. The first method changes the Local Preference values for every route distributed into iBGP from this router:
Router1#configure terminal
Enter configuration commands, one per line. End with CNTL/Z. Router1(config)#router bgp
Router1(config-router)#
65500
bgp default local-preference
Router1(config-router)#
200
exit
Router1(config)#end
Router1#
The second method uses route maps to give finer granularity control over which routes get what Local Preference values:
Router1#configure terminal
Enter configuration commands, one per line. End with CNTL/Z. Router1(config)#ip prefix-list
LOW_LP_PREFIXES
seq
10
permit
Router1(config)#
172.22.0.0/16
route-map
LOCALPREF
permit
Router1(config-route-map)#
10
match ip address prefix-list
Router1(config-route-map)#
LOW_LP_PREFIXES
set local-preference
Router1(config-route-map)#
50
exit
Router1(config)#route-map
LOCALPREF
permit
Router1(config-route-map)#
20
exit
Router1(config)#router bgp
Router1(config-router)#
65500
neighbor
192.168.1.5
remote-as
Router1(config-router)#
65510
neighbor
192.168.1.5
route-map
LOCALPREF
in
Router1(config-router)#exit
Router1(config)#end
Router1#
Discussion
When BGP routers within an AS exchange information about a particular route using iBGP, they include the Local Preference value. All of the routers in the AS are then able to use this ...
Get Cisco IOS Cookbook, 2nd Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.