EBGP直连邻居建立
[R1]bgp 1
[R1-bgp]route-select
[R1-bgp]router-id 1.1.1.1
[R1-bgp]peer 12.0.0.2 as-number 2
对AS2进行OSPF配置,确保AS内部形成通路
[R2]ospf 1 router-id 2.2.2.2
[R2-ospf-1]area 0
[R2-ospf-1-area-0.0.0.0]network 23.0.0.0 0.0.0.255
[R2-ospf-1-area-0.0.0.0]network 2.2.2.2 0.0.0.0
[R2]bgp 2
[R2-bgp]router-id 2.2.2.2
[R2-bgp]peer 12.0.0.1 as-number 1
进行IBGP对等体之间,使用环回接口建邻
[R4]bgp 2
[R4-bgp]router-id 4.4.4.4
[R4-bgp]peer 45.0.0.2 as-number 3
[R3-bgp]peer 2.2.2.2 connect-interface LoopBack 0
[R3-bgp]peer 4.4.4.4 connect-interface LoopBack 0
[R5]bgp 3
[R5-bgp]router-id 5.5.5.5
[R5-bgp]peer 45.0.0.1 as-number 2
[R1-bgp]network 1.1.1.0 24
[R2-bgp]peer 3.3.3.3 next-hop-local
[R2-bgp]peer 4.4.4.4 next-hop-local
[R5]int l0
[R5-LoopBack0]ip add 10.0.0.1 24
[R5-LoopBack0]q
[R5]bgp 3
[R5-bgp]network 10.0.0.0 24
[R4-bgp]peer 3.3.3.3 next-hop-local
[R4-bgp]peer 2.2.2.2 next-hop-local
[R1]int l1
[R1-LoopBack1]ip add 172.16.0.1 24
[R1-LoopBack1]int l2
[R1-LoopBack2]ip add 172.16.1.1 24
[R1]ip ip-prefix aa permit 172.16.0.0 16 greater-equal 24 less-equal 24
[R1]route-policy aa permit node 10
[R1-route-policy]if-match ip-prefix aa
[R1-bgp]import-route direct route-policy aa
[R4]ip ip-prefix aa permit 172.16.0.0 24
[R4]route-policy aa permit node 10
Info: New Sequence of this List.
[R4-route-policy]if-match ip-prefix aa
[R4]bgp 2
[R4-bgp]aggregate 172.16.0.0 23 suppress-policy aa