12.18 Configuring the Default Weight for a Neighbor

Consider the following scenario:

Weight is the first parameter checked for BGP path selection. It is also only locally significant, so it ultimately tells the router which path to prefer.

In the example, the customer wants to prefer the path over their primary ISP link in AS 65100. GW1 and GW2 are running iBGP, and the router GW2 configures the iBGP neighbor with a default weight of 100. This ensures that GW2 forwards all received traffic to router GW1, rather than preferring what is ultimately the shortest AS Path through router ISP2A.

The command to configure default weight is neighbor <ip address> weight <weight value>

Another option is to use route maps, which can be used to provide more granularity, and define weights to specific prefixes.