IBGP环回建邻
bgp 100
router-id 1.1.1.1
peer 4.4.4.4 as-number 100
peer 4.4.4.4 connect-interface LoopBack0
EBGP直连建邻
bgp 100
router-id 4.4.4.4
peer 5.5.5.5 as-number 101
peer 5.5.5.5 ebgp-max-hop 255
as100到as101只能有汇总通过
逐条宣告所有的明细路由,再进行标准的BGP聚合配置
network 1.1.1.1 255.255.255.255
network 2.2.2.2 255.255.255.255
network 3.3.3.3 255.255.255.255
network 4.4.4.4 255.255.255.255
network 45.1.1.0 255.255.255.0
network 172.16.0.0 255.255.255.252
network 172.16.0.4 255.255.255.252
network 172.16.0.8 255.255.255.252
network 172.16.0.10 255.255.255.255
network 172.16.0.11 255.255.255.255
network 172.16.0.12 255.255.255.252
network 172.16.0.16 255.255.255.252
network 172.16.0.20 255.255.255.252
network 172.16.0.24 255.255.255.252
network 172.16.0.25 255.255.255.255
network 172.16.0.27 255.255.255.255
aggregate 172.16.0.0 255.255.0.0 detail-suppressed
as101到as100除了汇总还有r8的两个环回通过,也是在r5上先逐条宣告明细路由,然后进行流量控制
[R5]ip ip-prefix xx permit 8.8.8.8 32
[R5]ip ip-prefix xx permit 192.168.0.25 32
[R5]route-policy yy deny node 10
Info: New Sequence of this List.
[R5-route-policy]if-match ip-prefix xx
[R5-route-policy]q
[R5]route-policy yy permit node 20
[R5]bgp 101
[R5-bgp]aggregate 192.168.0.0 24 detail-suppressed su
[R5-bgp]aggregate 192.168.0.0 24 detail-suppressed suppress-policy yy
[R5-bgp]q