BGP属性
—各种参数,用于BGP的选路,默认bgp协议将比对所有的参数选择唯一的路由;之所有使用大量的参数来选路,是因为可控性—管理员修改各个参数均可干涉选路- - -BGP协议没有优秀的选路算法,故正常BGP协议收敛的路径不一定是最佳路径;
5种公有基本属性,cisco存在一种私有的基本属性;
【1】Weight 权重值–cisco私有属性
传播范围 | 默认值 | 数值大优还是小优 |
---|---|---|
不传播 | 0-65535,本地32768,邻居为0 | 大 |
修改方式
r4(config)#router bgp 2
r4(config-router)#neighbor 3.3.3.3 weight 1
r4(config-router)#end
r4#clear ip bgp * soft
负载分担:到不同目标基于不同路径;基于个别路由进行属性修改
r4(config)#ip prefix-list w permit 2.2.2.0/24
r4(config)#route-map w permit 10
r4(config-route-map)#match ip address prefix-list w
r4(config-route-map)#set weight 1
r4(config-route-map)#exit
r4(config)#route-map w permit 20
r4(config-route-map)#exit
r4(config)#router bgp 2
r4(config-router)#neighbor 3.3.3.3 route-map w in
r4(config-router)#end
r4#clear ip bgp * soft
注:只能在入向调用,因为权重值不传播;
【2】本地优先级(local-pre)
—最常用于干涉IBGP邻居关系下的选路;第一个公有属性;
传播范围 | 默认值 | 数值大优还是小优 |
---|---|---|
IBGP邻居关系间 | 0-255,默认为100 | 大 |
修改方式
r3(config)#router bgp 2
r3(config-router)#bgp default local-preference 101
本地传递给本地所有IBGP邻居时,优先级修改为101;
基于本地优先级的负载分担:
r3(config)#ip prefix-list l permit 2.2.2.0/24
r3(config)#route-map l permit 10
r3(config-route-map)#match ip address prefix-list l
r3(config-route-map)#set local-prefer