Saturday 1 February 2020

Weight


Here am going to change the weight value.

Lets look on R5.
R5#sh ip bgp 4.1.0.1
BGP routing table entry for 4.1.0.0/24, version 268
Paths: (2 available, best #1, table Default-IP-Routing-Table)
  Advertised to update-groups:
     1
  400
    150.4.4.4 (metric 2297856) from 150.4.4.4 (150.4.4.4)
      Origin IGP, metric 0, localpref 100, valid, external, best
  100 400
    155.1.35.3 from 155.1.35.3 (150.3.3.3)
      Origin IGP, localpref 100, valid, external

To reach network 4.1.0.0 we have two path in that the best path is chosen according to shortest AS path.
See the weight is not set it means the weight is 0. lets have a look on bgp routing table.

R5#sh ip bgp
BGP table version is 270, local router ID is 150.5.5.5
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete

   Network          Next Hop            Metric LocPrf Weight Path
*> 4.1.0.0/24       150.4.4.4                0             0 400 i
*                             155.1.35.3                             0 100 400 i
*> 4.2.0.0/24       150.4.4.4                0             0 400 i
*                             155.1.35.3                             0 100 400 i
*> 4.3.0.0/24       150.4.4.4                0             0 400 i
*                             155.1.35.3                             0 100 400 i

See the weight is 0. So lets change the weight on R5 and make the all  prefix received from R3 is best than R4.
R5(config)#router bgp 500
R5(config-router)#neighbor 155.1.35.3 weight 10

This will make all the prefixes received from R3 the weight will be set to 10. Since there is a change in weight now R5 selects the best path according to the weight. Lets verify it.
R5#sh ip bgp 4.1.0.1
BGP routing table entry for 4.1.0.0/24, version 2
Paths: (2 available, best #1, table Default-IP-Routing-Table)
Flag: 0x820
  Advertised to update-groups:
     1
  100 400
    155.1.35.3 from 155.1.35.3 (150.3.3.3)
      Origin IGP, localpref 100, weight 10, valid, external, best
  400
    150.4.4.4 (metric 2297856) from 150.4.4.4 (150.4.4.4)
      Origin IGP, metric 0, localpref 100, valid, external

Note this command changes all the prefixes received from that particular neighbor.

R5#sh ip bgp
BGP table version is 12, local router ID is 150.5.5.5
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete

   Network          Next Hop            Metric LocPrf Weight Path
*> 4.1.0.0/24       155.1.35.3                            10 100 400 i
*                             150.4.4.4                0             0 400 i
*> 4.2.0.0/24       155.1.35.3                            10 100 400 i
*                             150.4.4.4                0             0 400 i
*> 4.3.0.0/24       155.1.35.3                            10 100 400 i
*                             150.4.4.4                0             0 400 I

Note Weight is locally significant.

No comments:

Post a Comment