实验拓扑:

一、weight(cisco私有)
1、传播范围:仅本路由器。
2、属性默认值:本地32768,学习到为0
3、优先级(越大越好),属性的变化只会影响本身。
方法1:R1配置:neighbor 2.2.2.2 weight 10

方法2:R1配置:
access-list 1 permit 3.3.3.0
route-map weight permit 10
match ip address 1
set weight 10
route-map weight permit 20
router bgp 1
neighbor 2.2.2.2 route-map weight in

二、Local Preference
1、传播范围:一个AS内部
2、属性默认值:100
3、优先级(越大越好)
定义:Local preference is used to advertise to IBGP neighbors about how to leave their AS。local preference属性用来告诉他们的IBGP邻居如何离开他们的AS。
方法1:R2上配置:bgp default local-preference 120
方法2:R2上配置:
access-list 1 permit 3.3.3.0
route-map loc permit 10
match ip address 1
set local-preference 120
route-map loc permit 20
router bgp 1
neighbor 1.1.1.1 route-map loc out
三、AS-Path
R4配置:
access-list 1 permit 3.3.3.0
route-map as permit 10
match ip address 1
set as-path prepend 6 6 6
route-map as permit 20
router bgp 1
neighbor 34.1.1.3 route-map as in
或者
R3配置:
access-list 1 permit 3.3.3.0
route-map as permit 10
match ip address 1
set as-path prepend 6 6 6
route-map as permit 20
router bgp 1
neighbor 34.1.1.4 route-map as out
四、MED
1、传播范围:1个AS内部
2、属性默认值:0
3、优先级:小好
MED is used to advertise to EBGP neighbors how to exit their AS to reach networks owned by this AS。
R2配置:
access-list 1 permit 1.1.1.0
route-map med permit 10
match ip address 1
set metric 10
route-map med permit 20
router bgp 1
neighbor 23.1.1.3 route-map med out
浙公网安备 33010602011771号