Influencing BGP Path Selection

Influencing BGP Path Selection
BGP was not created to be a fast protocol; it was created to allow as much
administrative control over route path selection as possible. Path selection is
controlled by manipulating BGP attributes, usually using route maps. You
can set a default local preference by using the command bgp default localpreference
and a default MED for redistributed routes with the defaultmetric
command under the BGP routing process. But by using route maps,
you can change attributes for certain neighbors only or for certain routes
only. The earlier section on route maps contains an example of using a route
map to set a local preference of 200 for specific redistributed routes. This is
higher than the default local preference of 120, so routers within the AS are
more likely to prefer that path than others.
Route maps can also be applied to routes sent to or received from a neighbor.
The following example shows a simple route map that sets MED on all
routes advertised out to an EBGP neighbor:
route-map MED permit 10
set metric 50
!
router bgp 65001
neighbor 10.1.1.1 route-map MED out
When attributes are changed, you must tell BGP to apply the changes. Either
clear the BGP session (clear ip bgp * ) or do a soft reset (clear ip bgp *
soft in | out). Routers using recent IOS versions will do a route refresh
when the session in cleared inbound.