实验十三BGP路由汇总

在这里插入图片描述
1、 AS123起ospf协议,R123建立bgp邻居关系,并且将R1的两个环回通告给BGP

[r2-bgp]dis bgp routing-table 
 BGP Local router ID is 10.0.12.2 
 Status codes: * - valid, > - best, d - damped,
               h - history,  i - internal, s - suppressed, S - Stale
               Origin : i - IGP, e - EGP, ? - incomplete
 Total Number of Routes: 2
 Network            NextHop        MED        LocPrf    PrefVal Path/Ogn
*>   192.168.1.0        10.0.12.1       0                     0      1i
    *>   192.168.2.0        10.0.12.1       0                     0      1i

2、使用aggregate detail-suppressed汇总

抑制明细路由
[r2-bgp]dis bgp routing-table 
 BGP Local router ID is 10.0.12.2 
 Status codes: * - valid, > - best, d - damped,
               h - history,  i - internal, s - suppressed, S - Stale
               Origin : i - IGP, e - EGP, ? - incomplete
 Total Number of Routes: 1
 Network            NextHop        MED        LocPrf    PrefVal Path/Ogn

 *>   192.168.0.0/16     10.0.12.1                             0      1i
但是此命令抑制缺少update报文的内容AS_path
加入as-set关键字即可
[r2-bgp]dis bgp routing-table 192.168.0.0
 BGP local router ID : 10.0.12.2
 Local AS number : 2
 Paths:   1 available, 1 best, 1 select
 BGP routing table entry information of 192.168.0.0/16:
 From: 10.0.12.1 (10.0.12.1)
 Route Duration: 00h05m20s  
 Direct Out-interface: GigabitEthernet0/0/1
 Original nexthop: 10.0.12.1
 Qos information : 0x0
 AS-path 1, origin igp, pref-val 0, valid, external, best, select, active, pre 2
55
 Aggregator: AS 1, Aggregator ID 10.0.12.1, Atomic-aggregate
 Advertised to such 2 peers:
    10.0.12.1
    10.0.23.3

3、将192.168.2.2这条明细也通告给AS23

使用suppress-policy
[r1-bgp]dis bgp routing-table 
 BGP Local router ID is 10.0.12.1 
 Status codes: * - valid, > - best, d - damped,
               h - history,  i - internal, s - suppressed, S - Stale
               Origin : i - IGP, e - EGP, ? - incomplete
 Total Number of Routes: 3
  Network            NextHop        MED        LocPrf    PrefVal Path/Ogn
 *>   192.168.0.0/16     127.0.0.1                             0      i
 s>   192.168.1.0        0.0.0.0         0                     0      i
     *>   192.168.2.0        0.0.0.0         0                     0      i
具体配置:
[r1]dis current-configuration configuration bgp
[V200R003C00]
#
bgp 1
 peer 10.0.12.2 as-number 2 
 #
 ipv4-family unicast
  undo synchronization
  aggregate 192.168.0.0 255.255.0.0 suppress-policy hcip 
  network 192.168.0.0 255.255.0.0 
  network 192.168.1.0 
  network 192.168.2.0 
  peer 10.0.12.2 enable
#
Return

4、只要有192.168.1.1路由则存在汇总路由负责则不再

使用orgin-policy关键字
[r1-bgp]dis bgp routing-table 
 BGP Local router ID is 10.0.12.1 
 Status codes: * - valid, > - best, d - damped,
               h - history,  i - internal, s - suppressed, S - Stale
               Origin : i - IGP, e - EGP, ? - incomplete


 Total Number of Routes: 3
  Network            NextHop        MED        LocPrf    PrefVal Path/Ogn

 *>   192.168.0.0/16     127.0.0.1                             0      i
 *>   192.168.1.0        0.0.0.0         0                     0      i
     *>   192.168.2.0        0.0.0.0         0                     0      i
现在去掉192.168.1.0这条路由
[r1-bgp]dis bgp routing-table 

 BGP Local router ID is 10.0.12.1 
 Status codes: * - valid, > - best, d - damped,
               h - history,  i - internal, s - suppressed, S - Stale
               Origin : i - IGP, e - EGP, ? - incomplete
 Total Number of Routes: 1
 Network            NextHop        MED        LocPrf    PrefVal Path/Ogn

 *>   192.168.2.0        0.0.0.0         0                     0      i
只有一条路由

5、修改BGP汇总路由的MED属性

使用attribute-policy
<r2>dis bgp routing-table 

 BGP Local router ID is 10.0.12.2 
 Status codes: * - valid, > - best, d - damped,
               h - history,  i - internal, s - suppressed, S - Stale
               Origin : i - IGP, e - EGP, ? - incomplet
 Total Number of Routes: 1
Network            NextHop        MED        LocPrf    PrefVal Path/Ogn

 *>   192.168.0.0/16     10.0.12.1       200                   0      1i
  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值