按照如上配置ip地址
为r1和r2 r4与r5这两个ebgp对等体配置静态
为r2 r3 r4这三个ibgp进行rip配置
为r1 r2 r3 r4r5起bgp
r1
bgp 1
router-id 1.1.1.1
peer 2.2.2.2 as-number 2
peer 2.2.2.2 ebgp-max-hop 2
peer 2.2.2.2 connect-interface LoopBack0
network 172.16.1.1 24
r2
bgp 2
router-id 2.2.2.2
peer 1.1.1.1 as-number 1
peer 1.1.1.1 ebgp-max-hop 2
peer 1.1.1.1 connect-interface LoopBack0
peer 3.3.3.3 as-number 2
peer 3.3.3.3 connect-interface LoopBack0peer 3.3.3.3 next-hop-local
peer 4.4.4.4 as-number 2
peer 4.4.4.4 connect-interface LoopBack0
peer 4.4.4.4 next-hop-local
r3
bgp 2
router-id 3.3.3.3
peer 2.2.2.2 as-number 2
peer 2.2.2.2 connect-interface LoopBack0peer 2.2.2.2 next-hop-local
peer 4.4.4.4 as-number 2
peer 4.4.4.4 connect-interface LoopBack0
peer 4.4.4.4 next-hop-local
r4
bgp 2
router-id 4.4.4.4
peer 2.2.2.2 as-number 2
peer 2.2.2.2 connect-interface LoopBack0peer 2.2.2.2 next-hop-local
peer 3.3.3.3 as-number 2
peer 3.3.3.3 connect-interface LoopBack0peer 3.3.3.3 next-hop-local
peer 5.5.5.5 as-number 3
peer 5.5.5.5 ebgp-max-hop 2peer 5.5.5.5 connect-interface LoopBack0
r5
bgp 3
router-id 5.5.5.5
peer 4.4.4.4 as-number 2
peer 4.4.4.4 ebgp-max-hop 2
peer 4.4.4.4 connect-interface LoopBack0
nework 172.16.2.1 24
在r1上pingr5的环回1