一、实验拓扑:

二、实验要求: 1、R4出站方向上部署set as-path prepend,使得4.4.4.0网段进入R2是增加AS长度; 2、验证:R3上关于4.4.4.0条目最优路径是否是R1?

三、命令部署: R4(config)#access-list 10 permit 4.4.4.0 0.0.0.255 R4(config)#route-map pl permit 10 R4(config-route-map)#match ip address 10 R4(config-route-map)#set as-path prepend 5 6 7 8 R4(config-route-map)#route-map pl permit 1000

R4(config)#router bgp 4 R4(config-router)#neighbor 24.1.1.2 route-map pl out

四、验证: R2#show ip bgp Network Next Hop Metric LocPrf Weight Path *> 4.4.4.0/24 24.1.1.4 0 0 4 5 6 7 8 I

R3#show ip bgp Network Next Hop Metric LocPrf Weight Path

  • i4.4.4.0/24 2.2.2.2 0 100 0 4 5 6 7 8 i *>i 1.1.1.1 0 100 0 4 i