3
How to Configure BGP Weight Attribute Weight is a Cisco proprietary BGP attributes that can be used to select a certain path. Here’s what you need to know about weight: Weight is the first BGP attribute in the list. Cisco proprietary so you won’t find it on other vendor routers. Weight is not exchanged between BGP routers. Weight is only local on the router. The path with the highest weight is preferred. Let me give you an example for BGP weight:

How to Configure BGP Weight Attribute

Embed Size (px)

DESCRIPTION

How to Configure BGP Weight Attribute

Citation preview

Page 1: How to Configure BGP Weight Attribute

How to Configure BGP Weight AttributeWeight is a Cisco proprietary BGP attributes that can be used to select a certain path. Here’s what you need to know about weight:

Weight is the first BGP attribute in the list. Cisco proprietary so you won’t find it on other vendor routers. Weight is not exchanged between BGP routers. Weight is only local on the router. The path with the highest weight is preferred.

Let me give you an example for BGP weight:

Router Jack in AS 1 can reach AS 3 through AS 2 or AS 4. If we want to ensure AS 2 is always used as the best path you can change the weight. In my example the weight for the path to AS 2 is set to 500 and higher than the weight of 400 for AS 4. Let’s see what this looks like on real Cisco routers, this is the topology that I will use:

Page 2: How to Configure BGP Weight Attribute

Above we have a simple scenario with two autonomous systems. Router Jim and John both have network 2.2.2.0/24 configured on their loopback0 interface and I’ll advertise that in BGP.

Jack(config)#router bgp 1Jack(config-router)#neighbor 192.168.12.2 remote-as 2Jack(config-router)#neighbor 192.168.13.3 remote-as 2James(config)#router bgp 2James(config-router)#neighbor 192.168.12.1 remote-as 1

Page 3: How to Configure BGP Weight Attribute

James(config-router)#neighbor 192.168.23.3 remote-as 2James(config-router)#network 2.2.2.0 mask 255.255.255.0John(config)#router bgp 2John(config-router)#neighbor 192.168.13.1 remote-as 1John(config-router)#neighbor 192.168.23.2 remote-as 2John(config-router)#network 2.2.2.0 mask 255.255.255.0

Above you’ll find the configuration for BGP, now let’s take a detailed look at router Jack:

Jack#show ip bgp BGP table version is 2, local router ID is 192.168.13.1Status codes: s suppressed, d damped, h history, * valid, > best, i - internal, r RIB-failure, S StaleOrigin codes: i - IGP, e - EGP, ? - incomplete

Network Next Hop Metric LocPrf Weight Path*> 2.2.2.0/24 192.168.12.2 0 0 2 i* 192.168.13.3 0 0 2 i

Router Jack decided to use 192.168.12.2 as the next hop. All the BGP attributes are the same so it came down to the router ID to select a winner. Now let’s change this behavior using the weight attribute…

Jack(config)#router bgp 1Jack(config-router)#neighbor 192.168.13.3 weight 500

You can configure weight per neighbor using the weight command. All prefixes from this neighbor will have a weight of 500.