BGP的同步.docx_第1页
BGP的同步.docx_第2页
BGP的同步.docx_第3页
BGP的同步.docx_第4页
BGP的同步.docx_第5页
已阅读5页,还剩2页未读 继续免费阅读

下载本文档

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

文档简介

BGP的同步基本原理:在BGP协议设计同步这个功能的作用是用来防止“路由黑洞”,所谓的路由黑洞是路由层面不具备去往该目的网段的路由,而数据到达时候全部都丢弃掉的这种现象被称作为路由黑洞。所谓的同步指的是iBGP与IGP的一种同步关系,为什么需要把BGP学习来的路由需要同步到IGP当中?运行BGP协议的两个路由器是使用单播的方式来进行对等体的建立,既然是单播那么就是以“空投”的形式来完成数据的传递,中间可能有其他的路由器,但是对于运行BGP的路由器来讲根本就不能判定是否跟对等体之间还有其他的路由器。一旦中间有其他的路由器那么势必会有路由黑洞。在同步开启的时候,同步判定原则如下:当通过iBGP对等体接受的路由信息,查看自身的IGP路由表,如果IGP的路由表中没有该路由信息,那么此条目不会被判定为可达的路由。如果IGP的路由表中有该路由信息,那么此路由被判定为可达的路由,可以安装到BGP表中或者继续传递下去。在现在IOS版本12.0之后同步会自动的被关闭掉。具体的原因我们到实验中来分析。BGP同步的命令为:synchronization实验拓扑:实验基本配置:R1:hostname R1!interface Loopback0 ip address !interface Serial0/0 ip address !router bgp 1 no synchronization-默认同步是关闭的 bgp router-id network mask neighbor remote-as 234 no auto-summary!ip http serverR2:hostname R2!interface Loopback0 ip address !interface Serial0/0 ip address !interface Serial0/1 ip address router ospf 1 router-id passive-interface Serial0/0 network 55 area 0!router bgp 234 no synchronization bgp router-id neighbor remote-as 1 neighbor remote-as 234 no auto-summary!R3:hostname R3!interface Loopback0 ip address !interface Serial0/0 ip address serial restart-delay 0!router ospf 1 router-id network 55 area 0R4:hostname R4!interface Loopback0 ip address !interface Serial0/0 ip address !interface Serial0/1 ip address !router ospf 1 router-id passive-interface Serial0/1 network 55 area 0!router bgp 234 no synchronization bgp router-id neighbor remote-as 234 neighbor remote-as 5 no auto-summaryR5:hostname R5!interface Loopback0 ip address !interface Serial0/0 ip address !router bgp 5 no synchronization bgp router-id network mask neighbor remote-as 234 no auto-summary实验中的对等体有:R1-R2,R2-R4,R4-R5来看一下BGP路由传递的情况:R1# show ip bgp BGP table version is 4, local router ID is Status codes: s suppressed, d damped, h history, * valid, best, i - internal, r RIB-failure, S StaleOrigin codes: i - IGP, e - EGP, ? - incomplete Network Next Hop Metric LocPrf Weight Path* /24 0 32768 i* /24 0 234 5 iR5#show ip bgp BGP table version is 4, local router ID is Status codes: s suppressed, d damped, h history, * valid, best, i - internal, r RIB-failure, S StaleOrigin codes: i - IGP, e - EGP, ? - incomplete Network Next Hop Metric LocPrf Weight Path* /24 0 234 1 i* /24 0 32768 i可以看到R1与R5都相互学习到对方的路由信息,那么我们来做一下测试:R1#ping source Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to , timeout is 2 seconds:Packet sent with a source address of .Success rate is 0 percent (0/5)此时已经出现了“路由黑洞”,一步一步的来追查信息。R1#show ip route Routing entry for /24 Known via bgp 1, distance 20, metric 0 Tag 234, type external Last update from 00:14:06 ago Routing Descriptor Blocks: * , from , 00:14:06 ago Route metric is 0, traffic share count is 1 AS Hops 2 Route tag 234R2#show ip route Routing entry for /24 Known via bgp 234, distance 200, metric 0 Tag 5, type internal Last update from 00:14:26 ago Routing Descriptor Blocks: * , from , 00:14:26 ago Route metric is 0, traffic share count is 1 AS Hops 1 Route tag 5R3#show ip route % Network not in table可以看到R3没有去往的路由信息,所有的数据全部都丢弃在R3,原因是R2与R4传递路由的时候是单播传递,R3直接转发BGP的更新数据分组,并没有读取里面的更新信息。由于默认情况下同步是关闭的,所以没有办法防止路由黑洞。接下来在R4开启路由的同步功能。R4(config)#router bgp 234R4(config-router)#synchronization来查看一下R4学习BGP路由的情况。R4#show ip bgpBGP table version is 6, local router ID is Status codes: s suppressed, d damped, h history, * valid, best, i - internal, r RIB-failure, S StaleOrigin codes: i - IGP, e - EGP, ? - incomplete Network Next Hop Metric LocPrf Weight Path* i/24 0 100 0 1 i* /24 0 0 5 i可以看到R4并没有认为为最优路由,原因是当通过iBGP对等体学习的路由在R4自身的IGP表中并没有这个条目,所以同步原则判定失败,R4没有安装进自己的BGP转发表,那么R5就不可能接受到该路由条目信息。解决办法可以在R2把R1传递过来的路由信息重发布到IGP中,那么R4的IGP路由表就有了该路由信息,再来看一下结果输出。R2(config)#router ospf 1R2(config-router)#redistribute bgp 234 subnets此时来查看R2的OSPF数据库:R2#show ip ospf database external OSPF Router with ID () (Process ID 1) Type-5 AS External Link States LS age: 53 Options: (No TOS-capability, DC) LS Type: AS External Link Link State ID: (External Network Number ) Advertising Router: LS Seq Number: 80000001 Checksum: 0xDACC Length: 36 Network Mask: /24 Metric Type: 2 (Larger than any link state path) TOS: 0 Metric: 1 Forward Address: External Route Tag: 1那么R4的IGP可以计算出该路由条目,那么此时查看一下R4的IGP路由。R4#show ip route Routing entry for /24 Known via ospf 1, distance 110, metric 1 Tag 1, type extern 2, forward metric 128 Last update from on Serial0/0, 00:01:57 ago Routing Descriptor Blocks: * , from , 00:01:57 ago, via Serial0/0 Route metric is 1, traffic share count is 1 Route tag 1IGP表中已经有了这个/24的路由条目,那么来查看一下BGP的转发表:R4#show ip bgp BGP table version is 8, local router ID is Status codes: s suppressed, d damped, h history, * valid, best, i - internal, r RIB-failure, S StaleOrigin codes: i - IGP, e - EGP, ? - incomplete Network Next Hop Metric LocPrf Weight Pathri/24 0 100 0 1 i* /24 0 0 5 i这个条目已经被当做最优的路由安装进BGP的转发表了,其中路由的前缀为r,原因为R4通过iBGP学习到/24、也通过OSPF学习到/24这个条目,通过多种不同的协议学习到相同的路由比较AD值,iBGP的AD值为200,OSPF的AD值为110。所以选择OSPF的路

温馨提示

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

评论

0/150

提交评论