1.划分网段
R5:192.168.1.0/26
骨干:192.168.1.0/27
环回:192.168.1.32/28
192.168.1.48/28
R6:192.168.1.64/26
骨干:192.168.1.64/27
环回:192.168.1.96/28
192.168.1.112/28
R7:192.168.1.128/26
骨干:192.168.1.128/27
环回:192.168.1.160/28
192.168.1.176/28
R8:192.168.1.192/26
环回:192.168.1.192/27
192.168.1.224/27
2.建立EBGP关系
R4和R5以环回建立EBGP关系
[r4]bgp 100
[r4-bgp]peer 192.168.1.33 as-number 101
[r4-bgp]peer 192.168.1.33 connect-interface LoopBack 0
[r4-bgp]peer 192.168.1.33 ebgp-max-hop
[r4]ip route-static 192.168.1.32 28 45.1.1.2
[r5]bgp 101
[r5-bgp]peer 172.16.9.1 as-number 100
[r5-bgp]peer 172.16.9.1 connect-interface LoopBack 0
[r5-bgp]peer 172.16.9.1 ebgp-max-hop
[r5]ip route-static 172.16.9.0 24 45.1.1.1
3.建立IGBP关系
[r1]bgp 100
[r1-bgp]peer 172.16.3.1 as-number 100
[r1-bgp]peer 172.16.3.1 connect-interface LoopBack 0
[r1-bgp]peer 172.16.6.1 as-number 100
[r1-bgp]peer 172.16.6.1 connect-interface LoopBack 0
[r1-bgp]peer 172.16.9.1 as-number 100
[r1-bgp]peer 172.16.9.1 connect-interface LoopBack 0
R2 3 4之间和R5 6 7 8之间同此一样
并且as100到as101汇总过去
[r4-bgp]aggregate 172.16.0.0 20 detail-suppressed
[r4-bgp]network 172.16.0.1 24
[r4-bgp]network 172.16.3.1 24
[r4-bgp]network 172.16.6.1 24
[r4-bgp]network 172.16.9.1 24
[r4-bgp]network 172.16.2.0 24
[r4-bgp]network 172.16.5.0 24
[r4-bgp]network 172.16.8.0 24
更改下一跳
[r4-bgp]peer 172.16.0.1 next-hop-local
[r4-bgp]peer 172.16.3.1 next-hop-local
[r4-bgp]peer 172.16.6.1 next-hop-local
并且R5上可以直接显示汇总条目
4.右边到左边R8环回是明细其他是汇总
[r5]ip ip-prefix aa permit 192.168.1.193 27
[r5]ip ip-prefix aa permit 192.168.1.225 27
[r5]route-policy bb permit node 10
Info: New Sequence of this List.
[r5-route-policy]if-match ip-prefix aa
[r5]bgp 101
[r5-bgp]aggregate 192.168.1.0 24 detail-suppressed suppress-policy bb