BGP的MA网络、自动汇总、聚合

拓扑图如下:

BGP的MA网络、自动汇总、聚合

 

 

首先看一个现象,我们把R2的环回口宣告进BGP中看看在R4上学到的这条路由有什么特

殊的么。

BGP的MA网络、自动汇总、聚合

 

看出有什么特别的了么?在R4上去往2.2.2.2的路由下一跳是R1的E1/0

这是为什么呢我们只是做了R4和R3的Ebgp邻居啊,这就是我们说的ICMP的重定向

我们在R4上做这条命令:

neighbor 192.168.1.3 soft-reconfiguration inbound(开启部分内存用来存储邻居发送的路由信息)

接着用:R4#sh ip bgp neighbors 192.168.1.3 received-routes 

发现:   Network          Next Hop            Metric LocPrf Weight Path

        *> 2.2.2.2/32       192.168.1.1                            i

这说明是R3给R4发的时候就已经将下一跳改了。

依据:收到的bgp路由和要发送的邻居在同一个MA网络 那么在发出时将下一跳改为收到路由的地址即上图的192.168.1.1 

 

BGP 的auto-summary

一般是在将比的路由重分布到BGP中时关闭。即ANY---->BGP

如上图我们将RIP重分布到BGP中看看效果。

R1(config)#router bgp 1

R1(config-router)#redistribute rip 

然后我们查看BGP路由

R1#sh ip bgp

BGP table version is 5, local router ID is 1.1.1.1

Status codes: suppressed, damped, history, valid, best, internal,

              RIB-failure, Stale

Origin codes: IGP, EGP, incomplete

 

   Network          Next Hop            Metric LocPrf Weight Path

*> 1.0.0.0          0.0.0.0                          32768 ?

*> 2.2.2.2/32       12.1.1.2                             i

*> 3.0.0.0          0.0.0.0                          32768 ?

*> 192.168.1.0      0.0.0.0                          32768 ?

对于上面下一跳为0.0.0.0的那就是表明本条路由是有自己发出的。

下面我们将自动汇总关闭看看有什么变化。

R1(config)#router bgp 1

R1(config-router)#no auto-summary

然后我们再来看看BGP的路由信息

 

 

 

R1#sh ip bgp

*Mar  01:04:16.675: %SYS-5-CONFIG_I: Configured from console by console

R1#sh ip bgp

BGP table version is 9, local router ID is 1.1.1.1

Status codes: suppressed, damped, history, valid, best, internal,

              RIB-failure, Stale

Origin codes: IGP, EGP, incomplete

 

   Network          Next Hop            Metric LocPrf Weight Path

*> 1.1.1.1/32       0.0.0.0                          32768 ?

*> 2.2.2.2/32       12.1.1.2                             i

*> 3.3.3.3/32       192.168.1.3                      32768 ?

*> 192.168.1.0      0.0.0.0                          32768 ?

看到有什么不同吗?我就不用说了吧~呵呵

 

下面我们来看看BGP 的聚合

首先我们再R2上模拟四条路由:200.1.16/17/18/19.0

然后通告明细之后开始做聚合。

有两种方法 首先我们可以写一条静态的指向空接口的。然后通告进BGP中

R2(config)#ip route 200.1.16.0 255.255.252.0 null 0

R2(config-router)#net 200.1.16.0 mask 255.255.252.0

第二种方法就是先通告明细路由然后再用aggregate来汇聚

R2(config-router)#aggregate-address 200.1.16.0 255.255.252.0            

  advertise-map  Set condition to advertise attribute

  as-set         Generate AS set path information

  attribute-map  Set attributes of aggregate

  nlri           Nlri aggregate applies to

  route-map      Set parameters of aggregate

  summary-only   Filter more specific routes from updates(只发汇总,抑制所有明细路由)

  suppress-map  Conditionally filter more specific routes from updates(用route-map抑制路由)

  <cr> (汇总也发送,明细也发送)

本文为自己学习所写,如有不足之处或者理解上的不足。希望大虾们能多多指出。

 

 

posted @ 2011-08-25 11:57  为极客而生  阅读(451)  评论(0编辑  收藏  举报