![]() ![]() |
9.6 | ![]() |
BGP Attributes | |
9.6.10 | ![]() |
Manipulating Local Preference |
In Figure ![]()
Using the bgp default local-preference command, set the Local Preference attribute on RTC and RTD as follows:bgp default local-preference 200 The configuration from RTC causes it to set the Local Preference of all updates from AS 100 to 150. The configuration from RTD causes it to set the Local Preference for all updates from AS 300 to 200. Because Local Preference is exchanged within the AS, both RTC and RTD determine that updates regarding network 170.10.0.0 have a higher Local Preference when they come from AS 300 than when they come from AS 100. As a result, all traffic in AS 256 destined for network 170.10.0.0 is sent RTD. As an alternate configuration, use a route map. Route maps provide more flexibility than the bgp default local-preference configuration command. When the bgp default local-preference command is used on RTD, the Local Preference attribute of all updates received by RTD will be set to 200. This includes updates from AS 34. The example configuration in Figure![]() Notice that the configuration shown in the Figure uses the ip as-path access-list command, which matches the regular expression ^300$. Essentially, this statement matches any routes that include AS 300 in their AS_Path attribute.With the configuration, the Local Preference attribute of any update coming from AS 300 is set to 200 by instance ten (10) of the route map, SETLOCALIN. Instance 20 of the route map accepts all other routes.
|