Commands to Tune BGP4Using the Local Preference and Weight Attributes

To configure the weight attribute, use the following command:

neighbor {ip-address | peer-group-name} weight weight Table 9-6 explains the meaning of the preceding syntax.

Table 9-6 An Explanation of the Command to Configure the Weight Attribute

Syntax

Description

neighbor

This identifies that the rest of the command is directed at a BGP-4 peer.

ip address

This is the IP address of the neighboring router.

peer-group-name

This identifies the BGP-4 peer group, if there is one.

weight weight This is proprietary to Cisco and is used in route selection. It is local to the router and, because it is not propagated to other routers, there is no problem with compatibility. When there are multiple paths, it selects a path to a destination with different next hops to the same destination. This identifies the weight attribute, and a value is placed immediately afterward. The default is 32768, although the range extends from 0 to 65535.

weight weight This is proprietary to Cisco and is used in route selection. It is local to the router and, because it is not propagated to other routers, there is no problem with compatibility. When there are multiple paths, it selects a path to a destination with different next hops to the same destination. This identifies the weight attribute, and a value is placed immediately afterward. The default is 32768, although the range extends from 0 to 65535.

The weight attribute selects the exit path out of the router when there are multiple paths to the same destination. The higher the weight value, the better the path. Figure 9-8 illustrates this, and Example 9-4 shows how the path through San Francisco is chosen.

Figure 9-8 The Weight Attribute and Selecting a Path

Figure 9-8 The Weight Attribute and Selecting a Path

Example 9-4 A Sample Configuration to Illustrate How to Tune the Weight Attribute

SanFrancisco# router bgp 100

neighbor 44.44.44.44 remote-as 400 neighbor 44.44.44.44 weight 200

! route to 130.16.0.0 from San Francisco will have 200 weight neighbor 167.55.191.17 remote-as 100 neighbor 167.55.191.17 weight 100

! route to 130.16.0.0 from NewYork will have 100 weight

The local preference is equally easy to configure, and the syntax is as follows:

bgp default local-preference value Table 9-7 explains the various parts of this command.

Table 9-7 Configuring the Local Preference Attribute

Syntax

Description

bgp default local-preference

This attribute is used to tell routers within the autonomous system

how to exit the autonomous system in the case of multiple paths. It is

the opposite of the MED attribute.

value

Local preference has a range from 0 to 4,294,967,295 (just over 4

billion).

Example 9-5 is based on Figure 9-9. The local preference set in the San Francisco router to 200 is propagated in the updates to all its peers. Likewise, the local preference of 140 set in the New York router is propagated to its peers. When Chicago has to decide on a path to the network 130.16.0.0, the local preference attribute dictates the New York router as the exit point from the autonomous system.

Figure 9-9 Using Local Preference to Select a Path

Figure 9-9 Using Local Preference to Select a Path

Example 9-5 A Sample Configuration to Illustrate How to Tune the Local Preference Attribute

SanFrancisco# router bgp 100

neighbor 33.33.33.33 remote-as 300 neighbor 167.55.191.1 remote-as 100 bgp default local-preference 150

NewYork# router bgp 100

neighbor 44.44.44.44 remote-as 400 neighbor 167.55.191.9 remote-as 100 bgp default local-preference 200

SanFrancisco# router bgp 100

neighbor 44.44.44.44 remote-as 400 neighbor 44.44.44.44 weight 200

! route to 130.16.0.0 from SanFrancisco will have 200 weight neighbor 167.55.191.17 remote-as 100 neighbor 167.55.191.17 weight 140

!route to 130.16.0.0 from NewYork will have 140 weight These configurations are reflected in the show commands in Example 9-6.

Was this article helpful?

0 0

Post a comment