如图:R1 R2在10区域,R3在20区域
R2和其他建立邻接关系
另外建立一个ACL,如下
access-list 101 permit ip host 3.3.3.3 host 255.255.255.255
一、修改权重(Weight)
特点:思科专有,直线与本地有效
实验修改3.3.3.3的权重
R2原始数据:
Network Next Hop Metric LocPrf Weight Path
*>i1.1.1.0/24 10.1.1.1 0 100 0 i
*> 3.3.3.3/32 20.1.1.3 0 0 20 i
1.修改从R3来的所有路由权重
R3(config-router)#neighbor 20.1.1.3 weight 200
Network Next Hop Metric LocPrf Weight Path
*>i1.1.1.0/24 10.1.1.1 0 100 0 i
*> 3.3.3.3/32 20.1.1.3 0 200 20 i
2.使用route-map修改3.3.3.3的权重
router bgp 10
neighbor 20.1.1.3 route-map change3333weight in
route-map change3333weight permit 10
match ip address 101
set weight 332
Network Next Hop Metric LocPrf Weight Path
*>i1.1.1.0/24 10.1.1.1 0 100 0 i
*> 3.3.3.3/32 20.1.1.3 0 332 20 i
二、修改本地优先级(local-preference)
特点:本AS有效
在R2修改3.3.3.3的本地优先级,会影响R1
router bgp 10
neighbor 20.1.1.3 route-map change3333local in
route-map change3333local permit 10
match ip address 101
set local-preference 333
R2:
Network Next Hop Metric LocPrf Weight Path
*> 1.1.1.0/24 0.0.0.0 0 32768 i
* i3.3.3.3/32 20.1.1.3 0 333 0 20 i
R1:
Network Next Hop Metric LocPrf Weight Path
*> 1.1.1.0/24 0.0.0.0 0 32768 i
* i3.3.3.3/32 20.1.1.3 0 333 0 20 i
三、修改AS-Path
特点:传播所有
router bgp 10
neighbor 20.1.1.3 route-map change3333path in
route-map change3333path permit 10
match ip address 101
set as-path prepend 20 20
R2:
Network Next Hop Metric LocPrf Weight Path
*>i1.1.1.0/24 10.1.1.1 0 100 0 i
*> 3.3.3.3/32 20.1.1.3 0 0 20 20 20 i
R1:
Network Next Hop Metric LocPrf Weight Path
*> 1.1.1.0/24 0.0.0.0 0 32768 i
* i3.3.3.3/32 20.1.1.3 0 100 0 20 20 20 i
四、修改MED
特点:影响下一个路由器,不会再传播
router bgp 10
neighbor 10.1.1.1 route-map change3333med out
route-map change3333med permit 10
match ip address 101
set metric 334
R1:
Network Next Hop Metric LocPrf Weight Path
*> 1.1.1.0/24 0.0.0.0 0 32768 i
* i3.3.3.3/32 20.1.1.3 334 100 0 20 i




评论