BGP Cisco-proprietary Weight Settings
ccnp-routing
Lab on the Cisco BGP weight setting, applied per prefix with a route map and per neighbor, to influence one router’s choice of outbound path.
- To influence an enterprise’s outbound route.
- A Cisco router can use BGP Weight on that single router to influence that one router’s choice of outbound route.
- 0-65,5353 (Defaults: 0 for learned routes, 32768 for locally injected routes)
- We cannot change the defaults
- Configuration
- per prefix: route-map
- per neighbor (all routes learned from this neighbor): neighbor weight
- Per prefix
- Scenario: In our BGP configuration, R2 selected R4 to reach 45.45.45.0/24. We want to change it using
weightso that R2 chooses R5 to reach 45.45.45.0/24.
R2#show ip bgp 45.45.45.0/24
BGP routing table entry for 45.45.45.0/24, version 4
Paths: (2 available, best #2, table default)
Advertised to update-groups:
11
Refresh Epoch 2
64510
5.5.5.5 from 5.5.5.5 (5.5.5.5)
Origin IGP, metric 0, localpref 100, valid, external
rx pathid: 0, tx pathid: 0
Refresh Epoch 1
64510
4.4.4.4 from 4.4.4.4 (4.4.4.4)
Origin IGP, metric 0, localpref 100, valid, external, best
rx pathid: 0, tx pathid: 0x0
R2(config)#ip prefix-list weight50 seq 10 permit 45.45.45.0/24
R2(config)#route-map RmW50 permit
R2(config-route-map)#match ip address prefix-list weight50
R2(config-route-map)#set weight 50
R2(config)#route-map RmW50 permit 20
R2(config-route-map)#exit
R2(config)#router bgp 64500
R2(config-router)#neighbor 5.5.5.5 route-map RmW50 in
R2#clear ip bgp 5.5.5.5 soft # Because we only want to enable the weight of the incoming update from R5
R2#show ip bgp 45.45.45.0/24
BGP routing table entry for 45.45.45.0/24, version 6
Paths: (2 available, best #1, table default)
Advertised to update-groups:
11
Refresh Epoch 3
64510
5.5.5.5 from 5.5.5.5 (5.5.5.5)
Origin IGP, metric 0, localpref 100, weight 50, valid, external, best
rx pathid: 0, tx pathid: 0x0
Refresh Epoch 1
64510
4.4.4.4 from 4.4.4.4 (4.4.4.4)
Origin IGP, metric 0, localpref 100, valid, external
rx pathid: 0, tx pathid: 0
- Per neighbor:
- Scenario: By now, the weight of the path to R5 is 50 and R4 is 0. Let us change the weight of R4 to 60 to become the best path for R2 to reach 45.45.45.0/24
R2(config)#router bgp 64500 R2(config-router)#neighbor 4.4.4.4 weight 60 R2(config-router)#end R2#clear ip bgp 4.4.4.4 soft R2#show ip bgp 45.45.45.0/24 longer-prefixes BGP table version is 8, local router ID is 2.2.2.2 Network Next Hop Metric LocPrf Weight Path
- 45.45.45.0/24 5.5.5.5 0 50 64510 i *> 4.4.4.4 0 60 64510 i
Note that when we change the weight in this method (per neighbor), we do not have control over what subnets we want to change the weight for. Here, not only does R2 reach 45.45.45.0/24 from R4, but R2 also reaches 160.160.160.0/24 through R4.
R2#show ip bgp Network Next Hop Metric LocPrf Weight Path *> 12.12.12.0/24 0.0.0.0 0 32768 i
- i 1.1.1.1 0 100 0 i r i 13.13.13.0/24 3.3.3.3 0 100 0 i r>i 1.1.1.1 0 100 0 i
- 45.45.45.0/24 5.5.5.5 0 50 64510 i *> 4.4.4.4 0 60 64510 i
- i 160.160.160.0/24 3.3.3.3 0 100 0 64520 ?
*> 4.4.4.4 60 64510 64520 ?5.5.5.5 0 64510 64520 ?