BGP选路原则(1)-weight

 

1.       通过修改weight属性改变选路

R1R4分别与R2R3建立EBGP邻居关系

R1上建loopback0 IP 1.1.1 .1 networkBGP

R1 router-id 11.11.11 .11

R2 router-id 22.22.22 .22 以此类推

默认情况下R4bgp表中:

R4#sh ip bgp

BGP table version is 2, local router ID is 44.44.44.44

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

*  1.1.1 .0/24       34.1.1.3                               0 23 1 i

*>                  24.1.1.2                               0 23 1 i

根据选路原则,prefer the path with the lowest neighbor BGP router ID(因为前面的都相同),所以默认选择router-id小的为最优路径,即R2

下面更改weight值来改变选路:

R4

R4(config)#ip prefix-list 1 per 1.1.1 .0/24

R4(config)#route-map weight per 10

R4(config-route-map)#mat ip add prefix-list 1

R4(config-route-map)#set weight 100

R4(config)#router bgp 4

R4(config-router)#nei 34.1.1.3 route-map weight in

 

R4 BGP

R4#sh ip bgp

BGP table version is 3, local router ID is 44.44.44.44

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

*> 1.1.1 .0/24       34.1.1.3                             100 23 1 i

*                   24.1.1.2                               0 23 1 i

注:修改weightroute-map只能在bgpinbound方向应用

 

 

你可能感兴趣的:(职场,weight,休闲,BGP,选路原则)