BGP_as_path属于,路径越短越优先
1、抓取感应兴趣流
ip ip-prefix path1 index 10 permit 100.1.1.1 32 greater-equal 32 less-equal 32
2、建立路由策略
从R2方向来的路由
route-policy AS_PATH_P2 permit node 10
if-match ip-prefix path1
apply as-path 222 333 444 additive
从R3方向来的路由
route-policy AS_PATH_P3 permit node 10
if-match ip-prefix path1
apply as-path 666 additive
3、应用此策略导入
bgp 200
undo default ipv4-unicast
peer 12.1.1.2 as-number 100
peer 13.1.1.3 as-number 100
#
ipv4-family unicast
undo synchronization
peer 12.1.1.2 enable
peer 12.1.1.2 route-policy AS_PATH_P2 import
peer 13.1.1.3 enable
peer 13.1.1.3 route-policy AS_PATH_P3 import
4、展示结果
标签:1.2,ip,route,BGP,policy,PATH,peer,path From: https://blog.51cto.com/u_13560030/6969794