BGP路由协议下,从IBGP对等体学习到的路由不可以再想IBGP对等体传输,这是出于防止环路的考虑。解决这种问题有三种实现方法:

1.  建立full-mesh的对等体连接

2.  建立联邦

3.  使用路由反射器

路由反射器可以打破ibgp对等体之间不可以传输非自身产生路由的原则。RR可以让客户端之间共享路由信息,可以把客户端的信息传输给非客户端,也可以把非客户端的信息传输给客户端,但是,不可以把非客户端的路由信息传输给非客户端。

下面就路由反射器的一些特性用一个实验来说明。

拓扑如下:

 

基本配置:

R1#sh ip int b

Interface                  IP-Address      OK? Method Status                Protocol

FastEthernet0/0            unassigned      YES manual up                    up     

FastEthernet0/0.12         12.1.1.1        YES manual up                    up     

FastEthernet0/0.13         13.1.1.1        YES manual up                    up     

FastEthernet0/0.14         14.1.1.1        YES manual up                    up     

FastEthernet0/0.15         15.1.1.1        YES manual up                    up

 

R1#sh run | b router

router bgp 1

 no synchronization

 bgp router-id 1.1.1.1

 bgp log-neighbor-changes

 network 1.1.1.0 mask 255.255.255.0

 neighbor 12.1.1.2 remote-as 1

 neighbor 12.1.1.2 route-reflector-client

 neighbor 13.1.1.3 remote-as 1

 neighbor 14.1.1.4 remote-as 1

 neighbor 14.1.1.4 route-reflector-client

 neighbor 15.1.1.5 remote-as 1

 no auto-summary

 

R2#sh ip int b

Interface                  IP-Address      OK? Method Status                Protocol

FastEthernet0/0            unassigned      YES manual up                    up     

FastEthernet0/0.12         12.1.1.2        YES manual up                    up     

Loopback0                  2.2.2.2         YES manual up                    up     

。。。(OMIT

R2#sh run | b router

router bgp 1

 no synchronization

 bgp router-id 2.2.2.2

 bgp log-neighbor-changes

 network 2.2.2.0 mask 255.255.255.0

 neighbor 12.1.1.1 remote-as 1

 no auto-summary

 

R1,R2,R3.R4.R5都出于AS1,R1建立IBGP对等体关系,将1.1.1.02.2.2.03.3.3.04.4.4.05.5.5.0发布进BGPR2R4作为R1的路遇反射器的客户端。

 

下面看看各自的路由表。

 

R1#sh ip b

。。。omit

   Network          Next Hop            Metric LocPrf Weight Path

*> 1.1.1.0/24       0.0.0.0                  0         32768 i

*>i2.2.2.0/24       12.1.1.2                 0    100      0 i

*>i3.3.3.0/24       13.1.1.3                 0    100      0 i

*>i4.4.4.0/24       14.1.1.4                 0    100      0 i

*>i5.5.5.0/24       15.1.1.5                 0    100      0 i

 

R2#sh ip b

。。。。omit

   Network          Next Hop            Metric LocPrf Weight Path

*>i1.1.1.0/24       12.1.1.1                 0    100      0 i

*> 2.2.2.0/24       0.0.0.0                  0         32768 i

* i3.3.3.0/24       13.1.1.3                 0    100      0 i

* i4.4.4.0/24       14.1.1.4                 0    100      0 i

* i5.5.5.0/24       15.1.1.5                 0    100      0 i

 

R3#sh ip b

。。。。omit

   Network          Next Hop            Metric LocPrf Weight Path

*>i1.1.1.0/24       13.1.1.1                 0    100      0 i

* i2.2.2.0/24       12.1.1.2                 0    100      0 i

*> 3.3.3.0/24       0.0.0.0                  0         32768 i

* i4.4.4.0/24       14.1.1.4                 0    100      0 i

 

R4#sh ip b

。。。。omit

   Network          Next Hop            Metric LocPrf Weight Path

*>i1.1.1.0/24       14.1.1.1                 0    100      0 i

* i2.2.2.0/24       12.1.1.2                 0    100      0 i

* i3.3.3.0/24       13.1.1.3                 0    100      0 i

*> 4.4.4.0/24       0.0.0.0                  0         32768 i

* i5.5.5.0/24       15.1.1.5                 0    100      0 i

 

R5#sh ip b

。。。omit

   Network          Next Hop            Metric LocPrf Weight Path

*>i1.1.1.0/24       15.1.1.1                 0    100      0 i

* i2.2.2.0/24       12.1.1.2                 0    100      0 i

* i4.4.4.0/24       14.1.1.4                 0    100      0 i

*> 5.5.5.0/24       0.0.0.0                  0         32768 i

 

注:上述试验并没有建立IGP,因此上述非直连路由并没有装入路由表。