最新BGP同步详解.docx
精品资料BGP同步详解.BGP同步详解一:不学习或宣告从IBGP学习到的路由信息给EBGP的邻居,除非从IGP路由信息中 有这条路由信息。 二:如果不是通过IGP得到的路由,或者是下一跳不可达。就不能将IBGP学习到的路 由安装在路由表中.原因,如果一台ibgp路由器后面在接一个as,那么就满足第一bgp同步 定义,所以像这第二种意思,是同步更深一步的理解。千万注意。 设备需求:Cisco2501路由器三台实验拓扑:实验步骤:第一步:配置ip地址如下: r1#sho ip int brInterface IP-Address OK? Method Status Protocol Serial2/1 12.0.0.1 YES manual up up Loopback0 1.1.1.1 YES manual up up r2#sho ip int brInterface IP-Address OK? Method Status Protocol Serial2/1 12.0.0.2 YES manual up up Serial2/2 23.0.0.2 YES manual up up r3#sho ip int brInterface IP-Address OK? Method Status Protocol Serial2/1 23.0.0.3 YES manual up up Serial2/2 34.0.0.3 YES manual up up Loopback0 3.3.3.3 YES manual up up 第二步:r1(config)#router br1(config)#router bgp 1r1(config-router)#nei 12.0.0.2 remote 2r1(config-router)#net 1.1.1.0 mask 255.255.255.0 r2(config)#router br2(config)#router bgp 2r2(config-router)#nei 12.0.0.1 remote 1r2(config-router)#nei 23.0.0.3 remote 2 r3(config)#router br3(config)#router bgp 2r3(config-router)#nei 23.0.0.2 remote 2r3(config-router)#net 3.3.3.0 mask 255.255.255.0第三步:r1#sho ip bgp BGP table version is 3, local router ID is 1.1.1.1Status 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*> 1.1.1.0/24 0.0.0.0 0 32768 i r2#sho ip bgpBGP table version is 3, local router ID is 23.0.0.2Status 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*> 1.1.1.0/24 12.0.0.1 0 0 1 i*>i3.3.3.0/24 23.0.0.3 0 100 0 I r3#sho ip bBGP table version is 2, local router ID is 3.3.3.3Status 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* i1.1.1.0/24 12.0.0.1 0 100 0 1 i*> 3.3.3.0/24 0.0.0.0 0 32768 I 先验证第一条:不学习或宣告从IBGP学习到的路由信息给EBGP的邻居,除非从IGP路由信息中有这条路由信息可以看到r1上没有3.3.3.0/24这条路由,原因就是由于同步,r2没有传给r1. 现在关闭r2上的同步看看 r2(config)#router b 2r2(config-router)#no au再次查看 Network Next Hop Metric LocPrf Weight Path*> 1.1.1.0/24 0.0.0.0 0 32768 i*> 3.3.3.0/24 12.0.0.2 0 2 i现在r1上面有了3.3.3.0/24 这个条目,但是ping不通,因为没有igp路有消息r1#ping 3.3.3.3 Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 3.3.3.3, timeout is 2 seconds:.Success rate is 0 percent (0/5) 第四步:如果不是通过IGP得到的路由,或者是下一跳不可达。就不能将IBGP学习到的路 由安装在路由表中.现在r3中没有r1的路由条目先关闭r3的同步看看r3(config)#router br3(config)#router bgp 2r3(config-router)#no synchronization r3#sho ip rou 34.0.0.0/24 is subnetted, 1 subnetsC 34.0.0.0 is directly connected, Serial2/2 3.0.0.0/24 is subnetted, 1 subnetsC 3.3.3.0 is directly connected, Loopback0 23.0.0.0/24 is subnetted, 1 subnetsC 23.0.0.0 is directly connected, Serial2/1R3的 路由表里面现在还是没有,可以看到,是由于下一跳不可以达现在通过IGP学习路由r1(config)#router ei 120 r1(config-router)#net 12.0.0.0 r1(config-router)#net 1.1.1.0 r2(config)#router ei 120r2(config-router)#net 12.0.0.0 r2(config-router)#net 23.0.0.0 r3(config)#router ei 120r3(config-router)#net 23.0.0.0 r3(config-router)#net 3.3.3.0 通过IGP学习到了路由 所以可以ping通r1#ping 3.3.3.3Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 3.3.3.3, timeout is 2 seconds:!Success rate