1、拓扑如下:R1,R2,R3,R4在同一个AS中,其中R1和R2作为RR,R3,R4作为客户端对等体被两个RR共同拥有,R3与R4之间没有建立对等体。基本配置:R1R1#sh ipint bInterface IP-Address OK? Method Status ProtocolFastEthernet0/0 unassigned YES manual up upFastEthernet0/0.12 12.1.1.1 YES manual up upFastEthernet0/0.13 13.1.1.1 YES manual up upFastEthernet0/0.14 14.1.1.1
2、YES manual up upLoopback0 10.1.1.1 YES manual up up。(omit)R1#sh run | b router routerbgp 1no synchronizationbgp router-id 1.1.1.1bgp log-neighbor-changesnetwork 10.1.1.0 mask 255.255.255.0neighbor 12.1.1.2 remote-as 1neighbor 13.1.1.3 remote-as 1neighbor 13.1.1.3 route-reflector-clientneighbor 14.1.
3、1.4 remote-as 1neighbor 14.1.1.4 route-reflector-clientno auto-summaryR2R2#sh ipint bFastEthernet0/0.12 12.1.1.2 YES manual up upFastEthernet0/0.23 23.1.1.2 YES manual up upFastEthernet0/0.24 24.1.1.2 YES manual up upLoopback0 20.1.1.1 YES manual up up(omit)R2#sh run | b router bgp router-id 2.2.2.2
4、network 20.1.1.0 mask 255.255.255.0neighbor 12.1.1.1 remote-as 1neighbor 23.1.1.3 remote-as 1neighbor 23.1.1.3 route-reflector-clientneighbor 24.1.1.4 remote-as 1neighbor 24.1.1.4 route-reflector-clientR3R3#sh ipint bFastEthernet0/0.13 13.1.1.3 YES manual up upFastEthernet0/0.23 23.1.1.3 YES manual
5、up upLoopback0 30.1.1.1 YES manual up up.(omit)R3#sh run | b router bgp router-id 3.3.3.3network 30.1.1.0 mask 255.255.255.0neighbor 13.1.1.1 remote-as 1neighbor 23.1.1.2 remote-as 1R4配置与R3基本一致,略。1.看看R1向R2反射了那些路由R1#sh ip b nei 12.1.1.2 advertised-routes BGP table version is 9, local router ID is 1.1
6、.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* 10.1.1.0/24 0.0.0.0 0 32768 ii30.1.1.0/24 13.1.1.3 0 100 0 ii40.1.1.0/24 14.1.1.4 0 100 0 i切到R2上,选取一条路由来研究
7、,比如选了30.1.1.0/24这条路由R2#sh ip b 30.1.1.0 BGP routing table entry for 30.1.1.0/24, version 8Paths: (2 available, best #1, table Default-IP-Routing-Table) #选取1号来源为最佳路由 Advertised to non peer-group peers: 12.1.1.1 24.1.1.4 #R2将这条前缀反射给了非对等体组成员R1和R4 Local, (Received from a RR-client) 23.1.1.3 from 23.1.1.
8、3 (3.3.3.3) Origin IGP, metric 0, localpref 100, valid, internal, best Local 13.1.1.3 (inaccessible) from 12.1.1.1 (1.1.1.1) Origin IGP, metric 0, localpref 100, valid, internal Originator: 3.3.3.3, Cluster list: 1.1.1.1 #两个RR防环属性属性R2收到两条关于30.1.1.0/24的更新,一条是来自于R3的,一条是来自于R1的。2.下面我们在R2上打开debug,然后在R1上软
9、重启,看看路由更新的发送情况。R2#deb ip b upBGP updates debugging is onR2#*Mar 1 00:25:08.195: BGP(0): 12.1.1.1 rcvd UPDATE w/ attr: nexthop 12.1.1.1, origin i, localpref 100, metric 0 12.1.1.1 rcvd 10.1.1.0/24.duplicate ignored08.199: nexthop 14.1.1.4, origin i, localpref 100, metric 0, originator 4.4.4.4, cluste
10、rlist 1.1.1.1 12.1.1.1 rcvd 40.1.1.0/24.duplicate ignored nexthop 13.1.1.3, origin i, localpref 100, metric 0, originator 3.3.3.3, clusterlist 1.1.1.1 12.1.1.1 rcvd 30.1.1.0/24.duplicate ignored如上所示,发送了三条更新。3.接下来在R1和R2上手动配置相同的cluster-id(前面说过了,默认情况下的cluster-id就是RR的RID)R1(config)#router b 1R1(config-r
11、outer)#bgpclusR1(config-router)#bgp cluster-id 12.1.1.1R2(config)#router b 1R2(config-router)#b clusR2(config-router)#b cluster-id 12.1.1.14.再来看看R1向R2发送了哪些更新R1#sh ip b nei 12.1.1.2 ad跟以前一样!是不是上面的命令不起作用呢?再来看看R2的路由表R2#sh ip b BGP table version is 9, local router ID is 2.2.2.2i10.1.1.0/24 12.1.1.1 0 10
12、0 0 i 20.1.1.0/24 0.0.0.0 0 32768 ii30.1.1.0/24 23.1.1.3 0 100 0 ii40.1.1.0/24 24.1.1.4 0 100 0 i如上所示,并没有R1向它发送更新。这时还是要通过debug来看看R2#deb ipbgp up35:02.671:02.675: BGP: 12.1.1.1 RR in same cluster. Reflected update dropped 12.1.1.1 rcv UPDATE w/ attr: nexthop 14.1.1.4, origin i, localpref 100, metric
13、0, originator 4.4.4.4, clusterlist 12.1.1.1, path , community , extended community 12.1.1.1 rcv UPDATE about 40.1.1.0/24 - DENIED due to: reflected from the same cluster; nexthop 13.1.1.3, origin i, localpref 100, metric 0, originator 3.3.3.3, clusterlist 12.1.1.1, path , community , extended commun
14、ity 12.1.1.1 rcv UPDATE about 30.1.1.0/24 - DENIED due to:这样就明白了吧!可能会有这样的疑问,10.1.1.0/24这个网段上面显示的也被拒绝了,为什么路由表里面还有?这是因为如果一个路由条目是RR自身发起的话,那么他不会在这个条目上创建cluster-id。而且,RR从外部对等体学习到的路由信息,在反射给自己的客户端或者为非客户端时,也不会为这前缀创建cluster-id。我们可以切到R3上来看看10.1.1.0/24这个信息被两个RR反射给R3时有携带的属性什么不同。R3#sh ip b 10.1.1.0BGP routing ta
15、ble entry for 10.1.1.0/24, version 7 (2 available, best #2, table Default-IP-Routing-Table) Not advertised to any peer 12.1.1.1 (inaccessible) from 23.1.1.2 (2.2.2.2)Originator: 1.1.1.1, Cluster list: 12.1.1.1 13.1.1.1 from 13.1.1.1 (1.1.1.1)第一个是从R2发过去的,下面的一个是从R1发过去的。很明显,从R1发送过去的没有携带originator和cluster-id这两个属性。
copyright@ 2008-2022 冰豆网网站版权所有
经营许可证编号:鄂ICP备2022015515号-1