8.8 Issue with Using Private AS  Numbers
8.8.6
Configuration example: setting the local preference attribute
In the example, AS 256 receives route updates for network 170.10.0.0 from AS 100 and AS 300.
Lab Activity
  In this lab, you will learn how to configure the local preference attribute to indicate a preferred route to a destination with multiple routes.

There are two ways to set local preference:

  • Using the bgp default local preference Command
  • Using a route map to set local preference

Note: Click on topology to view command outputs.

Using the bgp default local preference Command

The configurations in the example use the bgp default local preference router configuration command to set the local preference attribute on routers C and D.
Router C's configuration causes it to set the local preference of all updates from AS 300 to 150, and router D's configuration causes it to set the local preference for all updates from AS 100 to 200. Because local preference is exchanged within the AS, both routers C and D 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 to router D.

Using a Route Map to Set Local Preference

Route maps provide more flexibility than the bgp default local preference configuration command. When the bgp default local preference command is used on router D in the example, the local preference attribute of all updates received by router D will be set to 200, including updates from AS 34. The following configuration uses a route map to set the local preference attribute on router D specifically for updates regarding AS 300:

With this configuration, the local preference attribute of any update coming from AS 300 is set to 200. Instance 20 of the SETLOCALIN route map accepts all other routes.