Determining the BGP Path by Tuning the Attributes

14 Mar

Determining the BGP Path by Tuning the Attributes
Now that you understand the network requirements for designing and configuring a BGP network, as well as methods for controlling BGP traffic through the network, you will learn how to configure BGP to take a path to a destination based on different criteria.

The attributes discussed in this section are local preference and weight, with the latter being a Ciscoproprietary solution.

Using the Local Preference and Weight Attributes
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. This command is a local command, and the attribute is not propagated to other routers. It is also proprietary to Cisco. To configure the weight attribute, use the following command:

Router(config-router)#neighbor { ip-address | peer-group-name} weight weight
Table 16-7 explains the meaning of the preceding syntax.
Table 16-7 An Explanation of the Command to Configure the Weight Attribute

Figure 16-8 illustrates the use of the weight attribute, and Example 16-5 shows how the path through San Francisco is chosen. As you can see, the weight has been set on Chicago, making it prefer the path through San Francisco no matter which network it is trying to reach. The best path to 130.16.0.0 is through New York. (Refer to Example 16-7 later in the chapter to see that the show ip bgp command on Chicago shows that the weight attribute forces San Francisco to be used as the next hop for all paths.)

Figure 16-8 The Weight Attribute and Selecting a Path

588 Chapter 16: Implementing and Tuning BGP for Use in Large Networks
Example 16-5 A Sample Configuration to Illustrate How to Tune the Weight Attribute (Continued)

The local preference is equally easy to configure. You can set it on either a default or a per-prefix
basis. The command to set the local preference on per-prefix basis follows:

Router(config-route-map)# set locall-preference local-preference
The syntax for the default command is as follows:
Router(config-router)#bgp default local-preference value

Table 16-8 explains the various parts of the default configuration command. The command to set the local preference on per-prefix basis was provided for reference only because it is outside the scope of this book.

Table 16-8 Configuring the Local Preference Attribute

Example 16-6 is based on Figure 16-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 100 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 highest local preference attribute dictates the San Francisco router as the exit point from the autonomous system.

The configurations in Examples 16-5 and 16-6 are extremely simple. Although they work well, you also need to understand route maps. Route maps allow the setting of attributes with conditions and other criteria. Although they are more complex, they are also more efficient. Route maps offer more flexibility with their greater level of sophistication. Route maps are explained in detail in Chapter 18.

Figure 16-9 Using Local Preference to Select a Path

Example 16-6 A Sample Configuration to Illustrate How to Tune the Local Preference Attribute (Continued)

Verifying the Configuration of Attributes
It is always important to be able to check your work, particularly when that work defines an entire organization’s method of connecting to the Internet.

The show ip bgp command shows all the values of all the attributes and their status. Therefore, this is a good command to verify any configurations that change attributes to tune the system and effectively manage the traffic flow to and from the autonomous system.

Examples 16-7 through 16-9 show sample output from the show ip bgp command.

Example 16-7 shows how BGP is running before the configuration in Example 16-5 or Example 16-6 has been run on the Chicago or San Francisco router. The next hop is to 100.2.3.2, which is in autonomous system 300 because the traffic would be routed via New York. Note in Example 16-7 that the local preference on Chicago has been set by the BGP process to be 100 by default.

Example 16-7 The show ip bgp Command Example for Chicago Before Attributes Are Set

Example 16-8 occurs after the configuration for Chicago; the weight is set to 200 for the neighbor 167.55.199.5, which is San Francisco. This forces the longest path to be taken to 130.16.0.0 via San Francisco.

Example 16-8 The show ip bgp Command Example Showing the Use of the Weight Attribute

Example 16-9 occurs after the San Francisco and New York routers are configured; it is possible to see a change in the neighbor table. The local preference shows that BGP packets destined to 130.16.0.0 still take the high road, against common sense, because the local preference instructs BGP that San Francisco has the best path. This attribute is propagated to other BGP neighbors. You can see that there is only one path shown in this table to 130.16.0.0. Because both New York and San Francisco agree that the path through New York is inferior, it is not sent. Note that the local preference to 167.55.191.3, known to its friends as New York, has a local preference of 100.

Example 16-9 The show ip bgp Command Example Showing the Use of the Local Preference Attribute

Table 16-9 describes significant fields shown in Examples 16-7 through 16-9.
Table 16-9 Explanation of Output from the show ip bgp Command

No comments yet

Leave a Reply

You must be logged in to post a comment.