实验拓扑图:
实验要求:
1、as100使用172.16.0.0/16,每个路由器上两个环回地址
2、as100使用192.168.0.0/24,每个路由器上两个环回
3、as100到as101的路由只能有汇总通过
4、as101到as100的路由除了汇总之外只允许r8的两个环回通过
5、全网可达
6、r4和r5之间使用环回建邻
一、配置底层IP以及各自区域的动态路由。
二、建立IBGP,在这里采用邻居关系全连(以R1、2、3、4为例)
[r1]bgp 100
[r1-bgp]router-id 1.1.1.1
[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.8.1 as-number 100
[r1-bgp]peer 172.16.8.1 connect-interface LoopBack 0
[r1-bgp]peer 172.16.10.1 as-number 100
[r1-bgp]peer 172.16.10.1 connect-interface LoopBack 0[r2]bgp 100
[r2-bgp]router-id 2.2.2.2
[r2-bgp]peer 172.16.4.1 as-number 100
[r2-bgp]peer 172.16.4.1 connect-interface LoopBack 0
[r2-bgp]peer 172.16.8.1 as-number 100
[r2-bgp]peer 172.16.8.1 connect-interface LoopBack 0
[r2-bgp]peer 172.16.10.1 as-number 100
[r2-bgp]peer 172.16.10.1 connect-interface LoopBack 0[r3]bgp 100
[r3-bgp]router-id 3.3.3.3
[r3-bgp]peer 172.16.6.1 as-number 100
[r3-bgp]peer 172.16.6.1 connect-interface LoopBack 0
[r3-bgp]peer 172.16.4.1 as-number 100
[r3-bgp]peer 172.16.4.1 connect-interface LoopBack 0
[r3-bgp]peer 172.16.10.1 as-number 100
[r3-bgp]peer 172.16.10.1 connect-interface LoopBack 0[r4]bgp 100
[r4-bgp]router-id 4.4.4.4
[r4-bgp]peer 172.16.6.1 as-number 100
[r4-bgp]peer 172.16.6.1 connect-interface LoopBack 0
[r4-bgp]peer 172.16.8.1 as-number 100
[r4-bgp]peer 172.16.8.1 connect-interface LoopBack 0
[r4-bgp]peer 172.16.4.1 as-number 100
[r4-bgp]peer 172.16.4.1 connect-interface LoopBack 0
三、建立EBGP
[r4]ip route-static 192.168.4.0 30 45.1.1.2
[r4]bgp 100
[r4-bgp]peer 192.168.4.1 as-number 101
[r4-bgp]peer 192.168.4.1 connect-interface l 0
[r4-bgp]peer 192.168.4.1 ebgp-max-hop //改多跳[r4-bgp]peer 172.16.4.1 next-hop-local
[r4-bgp]peer 172.16.6.1 next-hop-local
[r4-bgp]peer 172.16.6.1 next-hop-local[r5]ip route-static 172.16.10.0 30 45.1.1.2
[r5]bgp 101
[r5-bgp]peer 172.16.10.1 as-number 101
[r5-bgp]peer 172.16.10.1 connect-interface l 0
[r5-bgp]peer 172.16.10.1 ebgp-max-hop[r5-bgp]peer 192.168.6.1 next-hop-local //改下一跳
[r5-bgp]peer 192.168.8.1 next-hop-local
[r5-bgp]peer 192.168.10.1 next-hop-local
4.右边到左边R8环回是明细其他是汇总
[r5]ip ip-prefix aa permit 192.168.10.1 32
[r5]ip ip-prefix aa permit 192.168.11.1 32
[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
实验完成,全网可达