本文共 1276 字,大约阅读时间需要 4 分钟。
一、实验拓扑:
Note:这里只用R2、R3路由器二、实验要求:1、R2身后增加Lo1:20.20.20.20,并宣告进BGP进程中;2、R3上部署静态路由 出接口(必须是,否则有继承现象发生);3、R3在BGP进程下宣告20.20.20.20;4、R3上抓取流量,部署route-map,使得20.20.20.20最优路径的下一跳是2.2.2.25、查看R3上20.20.20.20的路由下一跳是否是0.0.0.0?这样是否有环路风险?6、验证:部署4、后,最优路径的下一跳是否是2.2.2.2三、命令部署:
1、2、3部署:R2(config)#int lo1R2(config-if)#ip add 20.20.20.20 255.255.255.0R2(config)#router bgp 123
R2(config-router)#network 20.20.20.0 mask 255.255.255.0R3(config)#ip route 20.20.20.0 255.255.255.0 f0/0
R3(config)#router bgp 123
R3(config-router)#network 20.20.20.0 mask 255.255.255.04、部署:
R3(config)#access-list 10 permit 20.20.20.0 0.0.0.255R3(config)#route-map pl permit 10R3(config-route-map)#match ip address 10R3(config-route-map)#set weight 32768R3(config-route-map)#route-map pl permit 20
R3(config-route-map)#match ip address 10R3(config-route-map)#set local-preference 200R3(config-route-map)#route-map permit 1000R3(config)#router bgp 123
R3(config-router)#neighbor 2.2.2.2 route-map pl in四、验证:
1、2、3部署完成后验证:R3#show ip bgpNetwork Next Hop Metric LocPrf Weight Path*> 20.20.20.0/24 0.0.0.0 0 32768 IR2#show ip bgp
Network Next Hop Metric LocPrf Weight Path转载于:https://blog.51cto.com/13856092/2137651