【理论准备】

 
aggregate命令用来在MBGP路由表中创建一条聚合路由。undo aggregate命令用来删除该条聚合路由。
 
 
detail-suppressed:仅通告聚合路由。
 
 
【实验拓扑及软件】
 

 
 本文实验采用的交换机是H3C模拟器,下载地址如下:http://forum.h3c.com/forum.php? mod=viewthread&tid=109740&highlight=H3C%E6%A8%A1%E6%8B%9F%E5%99%A8 有兴趣的朋 友可以在论坛上去下载
 
【实验过程】
 
一、在R2没有配置聚合前,我们来看R1的BGP路由和路由表:
[R1]dis bgp ro
 
 Total Number of Routes: 12
 
 BGP Local router ID is 10.1.3.1 
 Status codes: * - valid, > - best, d - damped,
               h - history,  i - internal, s - suppressed, S - Stale
               Origin : i - IGP, e - EGP, ? - incomplete
     Network            NextHop         MED        LocPrf     PrefVal Path/Ogn
 
 *>  10.1.1.1/32        0.0.0.0         1562                  0       ?
 *>  10.1.2.0/24        0.0.0.0         0                     0       ?
 *>  10.1.2.1/32        0.0.0.0         0                     0       ?
 *>  10.1.2.2/32        0.0.0.0         0                     0       ?
 *>  10.1.3.0/24        0.0.0.0         0                     0       ?
 *                      10.1.3.2        0                     0       200?
 *>  10.1.3.1/32        0.0.0.0         0                     0       ?
 *                      10.1.3.2        0                     0       200?
 *>  10.1.3.2/32        0.0.0.0         0                     0       ?
 *>  11.1.1.1/32        10.1.3.2        0                     0       200?
 *>  11.1.2.1/32        10.1.3.2        0                     0       200?
 *>  11.1.3.1/32        10.1.3.2        0                     0       200?
 
[R1]
[R1]
 
[R1]dis ip ro
Routing Tables: Public
        Destinations : 12       Routes : 12
 
Destination/Mask    Proto  Pre  Cost         NextHop         Interface
 
10.1.1.1/32         OSPF   10   1562         10.1.2.1        S0/6/1
10.1.2.0/24         Direct 0    0            10.1.2.2        S0/6/1
10.1.2.1/32         Direct 0    0            10.1.2.1        S0/6/1
10.1.2.2/32         Direct 0    0            127.0.0.1       InLoop0
10.1.3.0/24         Direct 0    0            10.1.3.1        S0/6/0
10.1.3.1/32         Direct 0    0            127.0.0.1       InLoop0
10.1.3.2/32         Direct 0    0            10.1.3.2        S0/6/0
11.1.1.1/32         BGP    255  0            10.1.3.2        S0/6/0
11.1.2.1/32         BGP    255  0            10.1.3.2        S0/6/0
11.1.3.1/32         BGP    255  0            10.1.3.2        S0/6/0
127.0.0.0/8         Direct 0    0            127.0.0.1       InLoop0
127.0.0.1/32        Direct 0    0            127.0.0.1       InLoop0
 
 
 
 
二、R2配置聚合后看R1的BGP路由和路由表:
[R2-bgp]aggregate 11.1.0.0 255.255.0.0 
 
[R1]
[R1]dis bgp ro
 
 Total Number of Routes: 13
 
 BGP Local router ID is 10.1.3.1 
 Status codes: * - valid, > - best, d - damped,
               h - history,  i - internal, s - suppressed, S - Stale
               Origin : i - IGP, e - EGP, ? - incomplete
     Network            NextHop         MED        LocPrf     PrefVal Path/Ogn
 
 *>  10.1.1.1/32        0.0.0.0         1562                  0       ?
 *>  10.1.2.0/24        0.0.0.0         0                     0       ?
 *>  10.1.2.1/32        0.0.0.0         0                     0       ?
 *>  10.1.2.2/32        0.0.0.0         0                     0       ?
 *>  10.1.3.0/24        0.0.0.0         0                     0       ?
 *                      10.1.3.2        0                     0       200?
 *>  10.1.3.1/32        0.0.0.0         0                     0       ?
 *                      10.1.3.2        0                     0       200?
 *>  10.1.3.2/32        0.0.0.0         0                     0       ?
 *>  11.1.0.0/16        10.1.3.2        0                     0       200?
 *>  11.1.1.1/32        10.1.3.2        0                     0       200?
 *>  11.1.2.1/32        10.1.3.2        0                     0       200?
 *>  11.1.3.1/32        10.1.3.2        0                     0       200?
 
[R1]
[R1]dis ip ro
Routing Tables: Public
        Destinations : 13       Routes : 13
 
Destination/Mask    Proto  Pre  Cost         NextHop         Interface
 
10.1.1.1/32         OSPF   10   1562         10.1.2.1        S0/6/1
10.1.2.0/24         Direct 0    0            10.1.2.2        S0/6/1
10.1.2.1/32         Direct 0    0            10.1.2.1        S0/6/1
10.1.2.2/32         Direct 0    0            127.0.0.1       InLoop0
10.1.3.0/24         Direct 0    0            10.1.3.1        S0/6/0
10.1.3.1/32         Direct 0    0            127.0.0.1       InLoop0
10.1.3.2/32         Direct 0    0            10.1.3.2        S0/6/0
11.1.0.0/16         BGP    255  0            10.1.3.2        S0/6/0
11.1.1.1/32         BGP    255  0            10.1.3.2        S0/6/0
11.1.2.1/32         BGP    255  0            10.1.3.2        S0/6/0
11.1.3.1/32         BGP    255  0            10.1.3.2        S0/6/0
127.0.0.0/8         Direct 0    0            127.0.0.1       InLoop0
127.0.0.1/32        Direct 0    0            127.0.0.1       InLoop0
 
R2配置聚合并加了detail-suppressed参数后 后看R1的BGP路由和路由表:
 
[R2-bgp]aggregate 11.1.0.0 255.255.0.0 detail-suppressed 
 
[R1]
[R1]dis bgp ro
 
 Total Number of Routes: 10
 
 BGP Local router ID is 10.1.3.1 
 Status codes: * - valid, > - best, d - damped,
               h - history,  i - internal, s - suppressed, S - Stale
               Origin : i - IGP, e - EGP, ? - incomplete
     Network            NextHop         MED        LocPrf     PrefVal Path/Ogn
 
 *>  10.1.1.1/32        0.0.0.0         1562                  0       ?
 *>  10.1.2.0/24        0.0.0.0         0                     0       ?
 *>  10.1.2.1/32        0.0.0.0         0                     0       ?
 *>  10.1.2.2/32        0.0.0.0         0                     0       ?
 *>  10.1.3.0/24        0.0.0.0         0                     0       ?
 *                      10.1.3.2        0                     0       200?
 *>  10.1.3.1/32        0.0.0.0         0                     0       ?
 *                      10.1.3.2        0                     0       200?
 *>  10.1.3.2/32        0.0.0.0         0                     0       ?
 *>  11.1.0.0/16        10.1.3.2        0                     0       200?
 
[R1]
[R1]dis ip ro
Routing Tables: Public
        Destinations : 10       Routes : 10
 
Destination/Mask    Proto  Pre  Cost         NextHop         Interface
 
10.1.1.1/32         OSPF   10   1562         10.1.2.1        S0/6/1
10.1.2.0/24         Direct 0    0            10.1.2.2        S0/6/1
10.1.2.1/32         Direct 0    0            10.1.2.1        S0/6/1
10.1.2.2/32         Direct 0    0            127.0.0.1       InLoop0
10.1.3.0/24         Direct 0    0            10.1.3.1        S0/6/0
10.1.3.1/32         Direct 0    0            127.0.0.1       InLoop0
10.1.3.2/32         Direct 0    0            10.1.3.2        S0/6/0
11.1.0.0/16         BGP    255  0            10.1.3.2        S0/6/0
127.0.0.0/8         Direct 0    0            127.0.0.1       InLoop0
127.0.0.1/32        Direct 0    0            127.0.0.1       InLoop0
 
 
【配置文本】