2. Setting BGP Weight
Cisco Router - HOW TO
BGP ROUTE SELECTION
BGP route selection criteria in Cisco Routers take the weight parameter into consideration first. If a cisco router has two alternative paths
to the same destination, and their weight values are different, BGP selects the route with the highest weight value as the best. Only when
the two alternatives have equal weight is the next criterion, local preference, checked.
Weight is the first BGP attribute in the list to be checked, in order to select he best route to a destination
Weight is Cisco Proprietary attribute, so remember, you will find it only in Cisco routers
Weight attribute is local to a single router only, so constitutes a routing policy local to the router.
Weight value is never exchanged between BGP routers.
The router can assign the weight attribute to a route in two ways:
1. All routes that are received from a specific neighbor can be assigned a default weight value. This weight value indicates that the
neighbor is more preferred than the other neighbors.
2. A route-map that is applied on incoming routes from a neighbor can be used to select some routes and assign them weight values.
Today we are going to focus on first method. If configured, the default weight assignment on routes that are received from a neighbor is
applied first. All routes that are received from the neighbor are assigned a weight value as defined by the default weight.
4. Setting BGP Weight
Cisco Router - HOW TO
In the previous figure, the multihomed customer would like to use the primary link to the primary
Internet service provider (ISP) for all destinations. The weight is configured by the customer on
both BGP sessions, giving a higher weight to those routes that are received from the primary
ISP compared to those that are received from the backup ISP.
Any time that the multihomed customer receives routing information about the same IP
network number from both the ISPs, the customer compares the weights assigned to the routes.
Those received from the primary ISP will always win this comparison. The multihomed
customer sends the outgoing IP packets to the destination network via the primary ISP
regardless of the other BGP attributes that are assigned to both alternatives.
By default, locally sourced routes are assigned a weight of 32768.
CONFIGURING PER NEIGHBOR WEIGHT
5. Setting BGP Weight
Cisco Router - HOW TO
To assign a weight to a neighbor connection, use the neighbor weight router configuration command.
neighbor {ip-address | peer-group-name} weight weight
To remove a weight assignment, use the no form of this command.
no neighbor {ip-address | peer-group-name} weight weight
Syntax Description
Parameter Description
ip-address IP address of neighbor.
peer-group-name Name of a BGP peer group.
weight Weight to assign. Acceptable values are 0 to 65535.
All routes that are received from the neighbor after the configuration line is in place are assigned the weight value. To make sure that all
routes from the neighbor receive the new weight value, you can restart the BGP session, thus forcing the neighbor to resend all routes. If no
weight value is specified, the default value of 0 is applied. Restarting of BGP sessions might be necessary after making a configuration change
in the routing policy. The configuration change itself will not alter the already-received routes. The clear ip bgp EXEC command tears down
the BGP session, and the session automatically restarts.
CONFIGURING PER NEIGHBOR WEIGHT
6. Setting BGP Weight
Cisco Router - HOW TO
To display entries in the BGP routing table, use the show ip bgp EXEC command, as you can see in the following exemple:
route-views>sh ip bgp
BGP table version is 16890690, local router ID is 128.223.51.103
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,
x best-external, a additional-path, c RIB-compressed,
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found
Network Next Hop Metric LocPrf Weight Path
* 1.0.0.0/24 198.51.75.1 0 62752 23523 6327 15169 i
* 217.75.96.60 0 0 16150 15169 i
* 192.241.164.4 0 62567 15169 i
* 1.0.4.0/24 198.51.75.1 0 62752 6939 4826 56203 i
* 192.241.164.4 0 62567 6939 4826 56203 i
* 69.31.111.244 0 0 4436 3257 4826 56203 i
* 1.0.5.0/24 198.51.75.1 0 62752 6939 4826 56203 i
* 192.241.164.4 0 62567 6939 4826 56203 i
* 69.31.111.244 0 0 4436 3257 4826 56203 i
* 203.181.248.168 0 7660 4635 4826 56203 i
* 1.0.6.0/24 198.51.75.1 0 62752 6939 4826 56203 i
* 192.241.164.4 0 62567 6939 4826 56203 i
* 69.31.111.244 0 0 4436 3257 4826 56203 i
* 203.181.248.168 0 7660 4635 4826 56203 i
MONITORING BGP ROUTE SELECTION AND WEIGHT
7. Setting BGP Weight
Cisco Router - HOW TO
Without any argument, the show ip bgp command displays the entire BGP table. The routes
that are selected as the best are indicated by the “>” character.
The show ip bgp command provides a printout of all routes in the BGP table. Each route is
displayed on one line.
The printout is sorted in network number order. If there is more than one route to the same
network, the network number is printed on the first line only. The other routes to the same
network have their network field left blank on the output
MONITORING BGP ROUTE SELECTION
AND WEIGHT
8. Setting BGP Weight
Cisco Router - HOW TO
See hints on www.ipmax.it
Or email us your questions to info_ipmax@ipmax.it
9. Setting BGP Weight
Cisco Router - HOW TO
IPMAX is a Cisco Partner in Italy.
IPMAX is the ideal partner for companies seeking quality in products and services.
IPMAX guarantees method and professionalism to support its customers in selecting
technologies with the best quality / price ratio, in the design, installation,
commissioning and operation.
IPMAX srl
Via Ponchielli, 4
20063 Cernusco sul Naviglio (MI) – Italy
+39 02 9290 9171