BGP路由策略与选路控制.doc_第1页
BGP路由策略与选路控制.doc_第2页
BGP路由策略与选路控制.doc_第3页
BGP路由策略与选路控制.doc_第4页
BGP路由策略与选路控制.doc_第5页
已阅读5页,还剩3页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

BGP路由策略与选路控制1、 实验目标:根据BGP路由选择原则,用BGP属性控制BGP路由2、 网络拓扑图:3、 配置:IP地址如图所示用OSPF实现IGP路由可达BGP配置如下:no synchronization No auto-summary Update-source lo0 Next-hop-self R3和R4为同簇路由反射器,R1,R2分别为R3和R4的客户端 R3,R4建立普通IBGP邻居 R3,R4都发布10.0.0.0/16,10.2.0.0/16,10.4.0.0/16,10.3.0.0/16到BGP R5,R6发布10.5.0.0/16,10.6.0.0/16到BGP R1与R5,R2与R6建立EBGP现分析下面路由RT1#show ip bgp Network Next Hop Metric LocPrf Weight Path* i10.5.0.0/16 10.0.0.2 0 100 0 65001 i* 10.0.15.2 0 0 65001 i* i10.6.0.0/16 10.0.0.2 0 100 0 65001 i* 10.0.15.2 0 0 65001 i 根据EBGP路由优先于IBGP路由RT1#show ip bgp 10.5.0.0BGP routing table entry for 10.5.0.0/16, version 11Paths: (2 available, best #2, table Default-IP-Routing-Table) Advertised to update-groups: 2 65001 10.0.0.2 (metric 101) from 10.0.0.4 (10.0.0.4) Origin IGP, metric 0, localpref 100, valid, internal Originator: 10.0.0.2, Cluster list: 10.0.0.4 来自IBGP10.0.0.4反射的路由 65001 10.0.15.2 from 10.0.15.2 (10.5.0.1) 来自EBGP10.0.15.2的路由 Origin IGP, metric 0, localpref 100, valid, external, bestRT2#show ip bgp R2同R1 Network Next Hop Metric LocPrf Weight Path* 10.5.0.0/16 10.0.26.2 0 0 65001 i* i 10.0.0.1 0 100 0 65001 i* 10.6.0.0/16 10.0.26.2 0 0 65001 i* i 10.0.0.1 0 100 0 65001 iRT2#show ip bgp 10.5.0.0BGP routing table entry for 10.5.0.0/16, version 10Paths: (2 available, best #1, table Default-IP-Routing-Table) Advertised to update-groups: 2 65001 10.0.26.2 from 10.0.26.2 (10.6.0.1) Origin IGP, metric 0, localpref 100, valid, external, best 65001 10.0.0.1 (metric 101) from 10.0.0.3 (10.0.0.3) Origin IGP, metric 0, localpref 100, valid, internal Originator: 10.0.0.1, Cluster list: 10.0.0.3RT3#show ip bgp Network Next Hop Metric LocPrf Weight Path* i10.5.0.0/16 10.0.0.2 0 100 0 65001 i* i 10.0.0.2 0 100 0 65001 i*i 10.0.0.1 0 100 0 65001 i* i10.6.0.0/16 10.0.0.2 0 100 0 65001 i* i 10.0.0.2 0 100 0 65001 i*i 10.0.0.1 0 100 0 65001 i根据到达下一跳IGP开销小的RT3#show ip bgp 10.5.0.0BGP routing table entry for 10.5.0.0/16, version 18Paths: (3 available, best #3, table Default-IP-Routing-Table) Advertised to update-groups: 1 2 65001, (Received from a RR-client) 10.0.0.2 (metric 201) from 10.0.0.2 (10.0.0.2) 来自IBGP10.0.0.2 Origin IGP, metric 0, localpref 100, valid, internal 65001 10.0.0.2 (metric 201) from 10.0.0.4 (10.0.0.4) Origin IGP, metric 0, localpref 100, valid, internal Originator: 10.0.0.2, Cluster list: 10.0.0.4 10.0.0.4反射得来,只反射最佳路由 65001, (Received from a RR-client) 10.0.0.1 (metric 101) from 10.0.0.1 (10.0.0.1) 来自IBGP10.0.0.1 Origin IGP, metric 0, localpref 100, valid, internal, best注:R3上该路由的最佳路由来自RT1,所以不会反射回给RT1 同理,RT4不会反射给RT2RT4#show ip bgp R4同R3 Network Next Hop Metric LocPrf Weight Path*i10.5.0.0/16 10.0.0.2 0 100 0 65001 i* i 10.0.0.1 0 100 0 65001 i* i 10.0.0.1 0 100 0 65001 i*i10.6.0.0/16 10.0.0.2 0 100 0 65001 i* i 10.0.0.1 0 100 0 65001 i* i 10.0.0.1 0 100 0 65001 iRT4#show ip bgp 10.5.0.0 BGP routing table entry for 10.5.0.0/16, version 8Paths: (3 available, best #1, table Default-IP-Routing-Table) Advertised to update-groups: 1 2 65001, (Received from a RR-client) 10.0.0.2 (metric 101) from 10.0.0.2 (10.0.0.2) Origin IGP, metric 0, localpref 100, valid, internal, best 65001 10.0.0.1 (metric 201) from 10.0.0.3 (10.0.0.3) Origin IGP, metric 0, localpref 100, valid, internal Originator: 10.0.0.1, Cluster list: 10.0.0.3 65001, (Received from a RR-client) 10.0.0.1 (metric 201) from 10.0.0.1 (10.0.0.1) Origin IGP, metric 0, localpref 100, valid, internalR5、R6选路根据EBGP路由优先于IBGP路由RT5#show ip bgp Network Next Hop Metric LocPrf Weight Path* i10.0.0.0/16 10.6.0.1 0 100 0 65000 i* 10.0.15.1 0 65000 i* i10.2.0.0/16 10.6.0.1 0 100 0 65000 i* 10.0.15.1 0 65000 i* i10.3.0.0/16 10.6.0.1 0 100 0 65000 i* 10.0.15.1 0 65000 i* i10.4.0.0/16 10.6.0.1 0 100 0 65000 i* 10.0.15.1 0 65000 iRT6#show ip bgp Network Next Hop Metric LocPrf Weight Path* i10.0.0.0/16 10.5.0.1 0 100 0 65000 i* 10.0.26.1 0 65000 i* i10.2.0.0/16 10.5.0.1 0 100 0 65000 i* 10.0.26.1 0 65000 i* i10.3.0.0/16 10.5.0.1 0 100 0 65000 i* 10.0.26.1 0 65000 i* i10.4.0.0/16 10.5.0.1 0 100 0 65000 i* 10.0.26.1 0 65000 i现将R3,R4加入到同一个簇,这样R3不会反射给R4,R4也不会反射给R3因为Cluster list同为10.0.0.3,防环RT4(config)#router bgp 65000RT4(config-router)#bgp cluster-id 10.0.0.3RT4#show ip bgp Network Next Hop Metric LocPrf Weight Path*i10.5.0.0/16 10.0.0.2 0 100 0 65001 i* i 10.0.0.1 0 100 0 65001 i*i10.6.0.0/16 10.0.0.2 0 100 0 65001 i* i 10.0.0.1 0 100 0 65001 i方案一:调节本地优先级本地优先级 local-preference默认为100,越大越优先,调节 local-preference控制路由将RT1从RT5收到的10.5.0.0/16路由本地优先级设为300,大于RT2的100将RT2从RT6收到的10.6.0.0/16路由本地优先级设为300,大于RT1的100RT1(config)#ip prefix-list p3 seq 5 permit 10.5.0.0/16 匹配路由10.5.0.0/16RT1(config)#route-map rt1 permit 10 RT1(config-route-map)#match ip address prefix-list p3RT1(config-route-map)#set local-preference 300 设置该路由优先级为300RT1(config)#route-map rt1 permit 20 覆盖route-map的隐含拒绝RT1(config)#router bgp 65000RT1(config-router)#neighbor 10.0.15.2 route-map rt1 in 运用于来自邻居10.0.15.2的路由RT2(config)#ip prefix-list p3 permit 10.6.0.0/16 匹配路由10.6.0.0/16RT2(config)#route-map rt2 permit 10RT2(config-route-map)#match ip address prefix-list p3RT2(config-route-map)#set local-preference 300 RT2(config)#route-map rt2 permit 20RT2(config)#router bgp 65000RT2(config-router)#neighbor 10.0.26.2 route-map rt2 inRT1#clear ip bgp *RT2#clear ip bgp * 必须要清除BGP邻居重新建立RT1#show ip bgp Network Next Hop Metric LocPrf Weight Path* 10.5.0.0/16 10.0.15.2 0 300 0 65001 i *i10.6.0.0/16 10.0.0.2 0 300 0 65001 i* i 10.0.0.2 0 300 0 65001 i* 10.0.15.2 0 0 65001 i10.5.0.0/16的LocPrf为300,来自EBGP10.0.15.210.6.0.0/16的LocPrf为300,来自R2,优于来自10.0.15.2的该路由RT2#show ip bgp Network Next Hop Metric LocPrf Weight Path*i10.5.0.0/16 10.0.0.1 0 300 0 65001 i* i 10.0.0.1 0 300 0 65001 i* 10.0.26.2 0 0 65001 i* 10.6.0.0/16 10.0.26.2 0 300 0 65001 i10.5.0.0/16的LocPrf为300,来自R1,由于来自EBGP10.0.26.2的该条路由10.6.0.0/16的LocPrf为300,EBGP10.0.26.2 RT3#show ip bgp Network Next Hop Metric LocPrf Weight Path*i10.5.0.0/16 10.0.0.1 0 300 0 65001 i*i10.6.0.0/16 10.0.0.2 0 300 0 65001 iRT4#show ip bgp*i10.5.0.0/16 10.0.0.1 0 300 0 65001 i*i10.6.0.0/16 10.0.0.2 0 300 0 65001 i方案二:调节MEDBGP路由默认MED值为0,越小越优先将RT1发给RT5的路由10.2.0.0/16,10.4.0.0/16的MDE值设成789将RT2发给RT5的路由10.3.0.0/16的MDE值设成666RT1(config)#ip prefix-list bluefox seq 5 permit 10.2.0.0/16 匹配路由RT1(config)#ip prefix-list bluefox seq 10 permit 10.4.0.0/16RT1(config)#route-map med permit 10 RT1(config-route-map)#match ip add prefix-list bluefoxRT1(config-route-map)#set metric 789 设置MED RT1(config)#route-map med permit 20 覆盖隐含拒绝RT1(config)#router bgp 65000RT1(config-router)#neighbor 10.0.15.2 route-map med out 运用于邻居10.0.15.2 OUT方向RT2(config)#ip prefix-list bluefox seq 5 permit 10.3.0.0/16RT2(config)#route-map med permit 10RT2(config-route-map)#match ip address prefix-list bluefoxRT2(config-route-map)#set metric 666RT2(config)#route-map med permit 20RT2(config)#router bgp 65000RT2(config-router)#neighbor 10.0.26.2 route-map med out RT5#show ip bgp Network Next Hop Metric LocPrf Weight Path*i10.2.0.0/16 10.6.0.1 0 100 0 65000 i* 10.0.15.1 789 0 65000 i MED为789* 10.3.0.0/16 10.0.15.1 0 65000 i*i10.4.0.0/16 10.6.0.1 0 100 0 65000 i* 10.0.15.1 789 0 65000 iRT5上路由10.2.0.0/16和10.4.0.0/16来自10.0.15.1的MED为789,没来自10.6.0.1的优先 10.3.0.0/16来自10.0.15.1RT6#show ip bgp Network Next Hop Metric LocPrf Weight Path* 10.2.0.0/16 10.0.26.1 0 65000 i* 10.3.0.0/16 10.0.26.1 666 0 65000 i MDD为666*i 10.5.0.1 0 100 0 65000 i* 10.4.0.0/16 10.0.26.1 0 65000 i方案三:增加AS增加RT1发给RT5的路由10.2.0.0/16,10.4.0.0/16的As-path增加RT2发给RT5的路由10.3.0.0/16的As-pathRT1(config)#ip prefix-list bluefox seq 5 permit 10.2.0.0/16 匹配路由RT1(config)#ip prefix-list bluefox seq 10 permit 10.4.0.0/16RT1(config)#route-map as permit 10RT1(config-route-map)#match ip address prefix-list bluefoxRT1(config-route-map)#set as-path prepend 65000 65000 65000 增as-pathRT1(config)#route-map as permit 20RT1(config)#router bgp 65000RT1(config-router)#nei

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论